mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-01 19:11:15 +00:00
feat: add nvim-session-manager keybindings
This commit is contained in:
parent
5a56de1b9f
commit
15185f9ad6
2 changed files with 29 additions and 6 deletions
|
@ -15,13 +15,13 @@ in {
|
|||
]
|
||||
++ optionals (cfg.usePicker) ["dressing-nvim"];
|
||||
|
||||
vim.nnoremap = {
|
||||
"<leader>sl" = ":SessionManager load_session<CR>";
|
||||
"<leader>sd" = ":SessionManager delete_session<CR>";
|
||||
"<leader>sc" = ":SessionManager save_current_session<CR>";
|
||||
"<leader>slt" = ":SessionManager load_last_session<CR>";
|
||||
vim.maps.normal = mkMerge [
|
||||
(mkBinding cfg.mappings.loadSession ":SessionManager load_session<CR>" "Load session")
|
||||
(mkBinding cfg.mappings.deleteSession ":SessionManager delete_session<CR>" "Delete session")
|
||||
(mkBinding cfg.mappings.saveCurrentSession ":SessionManager save_current_session<CR>" "Save current session")
|
||||
(mkBinding cfg.mappings.loadLastSession ":SessionManager load_last_session<CR>" "Load last session")
|
||||
# TODO: load_current_dir_session
|
||||
};
|
||||
];
|
||||
|
||||
vim.luaConfigRC.nvim-session-manager = nvim.dag.entryAnywhere ''
|
||||
local Path = require('plenary.path')
|
||||
|
|
|
@ -8,6 +8,29 @@ with builtins; {
|
|||
options.vim.session.nvim-session-manager = {
|
||||
enable = mkEnableOption "Enable nvim-session-manager";
|
||||
|
||||
mappings = {
|
||||
loadSession = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
description = "Load session";
|
||||
default = "<leader>sl";
|
||||
};
|
||||
deleteSession = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
description = "Delete session";
|
||||
default = "<leader>sd";
|
||||
};
|
||||
saveCurrentSession = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
description = "Save current session";
|
||||
default = "<leader>sc";
|
||||
};
|
||||
loadLastSession = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
description = "Load last session";
|
||||
default = "<leader>slt";
|
||||
};
|
||||
};
|
||||
|
||||
usePicker = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
|
|
Loading…
Reference in a new issue