Neovim: add session management
This commit is contained in:
parent
d3cf892061
commit
eac0729a0f
1 changed files with 23 additions and 2 deletions
|
|
@ -372,6 +372,12 @@ in {
|
|||
key = ">";
|
||||
action = ">gv";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>qq";
|
||||
action = "<cmd>qa<cr>";
|
||||
options.desc = "Quit All";
|
||||
}
|
||||
];
|
||||
|
||||
plugins = {
|
||||
|
|
@ -475,14 +481,14 @@ in {
|
|||
vim.keymap.set(mode, l, r, { buffer = buffer, desc = desc})
|
||||
end
|
||||
|
||||
map("n", "<leader>h;", function()
|
||||
map("n", "<leader>g;", function()
|
||||
if vim.wo.diff then
|
||||
vim.cmd.normal({ "]c", bang = true })
|
||||
else
|
||||
gs.nav_hunk("next")
|
||||
end
|
||||
end, "Next Hunk")
|
||||
map("n", "<leader>h,", function()
|
||||
map("n", "<leader>g,", function()
|
||||
if vim.wo.diff then
|
||||
vim.cmd.normal({ "[c", bang = true })
|
||||
else
|
||||
|
|
@ -641,6 +647,7 @@ in {
|
|||
['<leader>s'] = { name = 'Search', _ = 'which_key_ignore' },
|
||||
['<leader>w'] = { name = 'Window', _ = 'which_key_ignore' },
|
||||
['<leader>t'] = { name = 'Toggle', _ = 'which_key_ignore' },
|
||||
['<leader>q'] = { name = 'Quit/Session', _ = 'which_key_ignore' },
|
||||
}
|
||||
end
|
||||
'';
|
||||
|
|
@ -792,6 +799,20 @@ in {
|
|||
}
|
||||
'';
|
||||
}
|
||||
{
|
||||
pkg = pkgs.unstable.vimPlugins.persistence-nvim;
|
||||
event = "BufReadPre";
|
||||
opts.__raw = /*lua*/ ''
|
||||
{ options =vim.opt.sessionoptions:get() }
|
||||
'';
|
||||
keys.__raw = /*lua*/ ''
|
||||
{
|
||||
{ "<leader>qs", function() require("persistence").load() end, desc = "Restore Session" },
|
||||
{ "<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" },
|
||||
}
|
||||
'';
|
||||
}
|
||||
|
||||
# Disabled for now as it tries to write org grammar to its own directory in the nix store
|
||||
# https://github.com/nvim-orgmode/orgmode/blob/95fb795a422f0455e03d13a3f83525f1d00793ad/lua/orgmode/utils/treesitter/install.lua#L9
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue