LazyVim.LazyVim/lua/lazyvim/plugins/util.lua

51 lines
1.7 KiB
Lua
Raw Normal View History

-- 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
2023-01-01 09:56:36 +01:00
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" },
},
},
},
},
},
2023-07-20 17:16:13 -04:00
-- 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.
2023-01-04 13:29:47 +01:00
{
"folke/persistence.nvim",
event = "BufReadPre",
opts = {},
2023-01-04 13:34:29 +01:00
-- stylua: ignore
2023-01-04 13:29:47 +01:00
keys = {
2023-01-04 13:34:29 +01:00
{ "<leader>qs", function() require("persistence").load() end, desc = "Restore Session" },
{ "<leader>qS", function() require("persistence").select() end,desc = "Select Session" },
2023-01-04 13:34:29 +01:00
{ "<leader>ql", function() require("persistence").load({ last = true }) end, desc = "Restore Last Session" },
{ "<leader>qd", function() require("persistence").stop() end, desc = "Don't Save Current Session" },
2023-01-04 13:29:47 +01:00
},
},
2023-01-03 21:05:22 +01:00
-- library used by other plugins
{ "nvim-lua/plenary.nvim", lazy = true },
2023-01-01 09:56:36 +01:00
}