refactor(snacks): move snacks specs to ui/util so that they show up in the generated docs

This commit is contained in:
Folke Lemaitre 2024-12-12 09:37:47 +01:00
parent 303980d267
commit ba632c500d
3 changed files with 51 additions and 42 deletions

View file

@ -1,5 +1,34 @@
-- Terminal Mappings
local function term_nav(dir)
---@param self snacks.terminal
return function(self)
return self:is_floating() and "<c-" .. dir .. ">" or vim.schedule(function()
vim.cmd.wincmd(dir)
end)
end
end
return {
-- Snacks utils
{
"snacks.nvim",
opts = {
bigfile = { enabled = true },
quickfile = { enabled = true },
terminal = {
win = {
keys = {
nav_h = { "<C-h>", term_nav("h"), desc = "Go to Left Window", expr = true, mode = "t" },
nav_j = { "<C-j>", term_nav("j"), desc = "Go to Lower Window", expr = true, mode = "t" },
nav_k = { "<C-k>", term_nav("k"), desc = "Go to Upper Window", expr = true, mode = "t" },
nav_l = { "<C-l>", term_nav("l"), desc = "Go to Right Window", expr = true, mode = "t" },
},
},
},
},
},
-- Session management. This saves your session in the background,
-- keeping track of open buffers, window arrangement, and more.
-- You can restore sessions when returning through the dashboard.