Add the auto session plugin for saving and reloading projects

This commit is contained in:
Tyler Kelley 2024-05-15 13:21:58 -05:00
parent 211627d542
commit 56f34c4753
2 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,11 @@
local auto_session = require("auto-session")
auto_session.setup({
auto_restore_enabled = false,
auto_session_suppress_dirs = { "~/", "~/Dev/", "~/Downloads", "~/Documents", "~/Desktop/" },
})
local keymap = vim.keymap
keymap.set("n", "<leader>wr", "<cmd>SessionRestore<CR>", { desc = "Restore session for cwd" }) -- restore last workspace session for current directory
keymap.set("n", "<leader>ws", "<cmd>SessionSave<CR>", { desc = "Save session for auto session root dir" }) -- save workspace session for current working directory

View File

@ -184,6 +184,7 @@ in
];
plugins = with pkgs.vimPlugins; [
alpha-nvim
auto-session
nvim-treesitter.withAllGrammars
lualine-nvim
nvim-web-devicons
@ -204,6 +205,7 @@ in
${builtins.readFile ../../config/nvim/keymaps.lua}
${builtins.readFile ../../config/nvim/options.lua}
${builtins.readFile ../../config/nvim/plugins/alpha.lua}
${builtins.readFile ../../config/nvim/plugins/auto-session.lua}
${builtins.readFile ../../config/nvim/plugins/nvim-tree.lua}
${builtins.readFile ../../config/nvim/plugins/telescope.lua}
${builtins.readFile ../../config/nvim/plugins/treesitter.lua}