diff --git a/.gitignore b/.gitignore index c362a62..57bef08 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ plugin .DS_Store +sessions diff --git a/lua/config/plugins.lua b/lua/config/plugins.lua index d5ac8be..286bd56 100644 --- a/lua/config/plugins.lua +++ b/lua/config/plugins.lua @@ -90,8 +90,8 @@ return packer.startup(function(use) use("L3MON4D3/LuaSnip") use("rafamadriz/friendly-snippets") use("onsails/lspkind.nvim") - use("zbirenbaum/copilot.lua") - use("zbirenbaum/copilot-cmp") + use("zbirenbaum/copilot.lua") + use("zbirenbaum/copilot-cmp") -- LSP use("williamboman/mason.nvim") @@ -135,6 +135,14 @@ return packer.startup(function(use) use("rcarriga/nvim-notify") use("ThePrimeagen/vim-be-good") use("aserowy/tmux.nvim") + use({ + "folke/persistence.nvim", + event = "BufReadPre", + module = "persistence", + config = function() + require("persistence").setup() + end, + }) if PACKER_BOOTSTRAP then require("packer").sync() diff --git a/lua/config/toggleterm.lua b/lua/config/toggleterm.lua index 9a5cc70..e10f795 100644 --- a/lua/config/toggleterm.lua +++ b/lua/config/toggleterm.lua @@ -4,7 +4,7 @@ import("toggleterm", function(toggleterm) terminal_mappings = true, insert_mappings = true, shade_terminals = false, - start_in_insert = false, + start_in_insert = true, }) function _G.set_terminal_keymaps() diff --git a/lua/config/which-key.lua b/lua/config/which-key.lua index 8db7f4d..2fc42d3 100644 --- a/lua/config/which-key.lua +++ b/lua/config/which-key.lua @@ -85,11 +85,11 @@ import("which-key", function(whichKey) ["g"] = { "TypescriptGoToSourceDefinition", "Go to source definition" }, ["r"] = { "TypescriptRenameFile", "Rename file" }, }, - ["r"] = { - name = "Rust", - ["r"] = { "RustRun", "Run" }, - ["a"] = { "RustRunnables", "Runnables"} - }, + ["r"] = { + name = "Rust", + ["r"] = { "RustRun", "Run" }, + ["a"] = { "RustRunnables", "Runnables" }, + }, ["u"] = { name = "Trouble", r = { "TroubleToggle lsp_references", "References" }, @@ -111,6 +111,12 @@ import("which-key", function(whichKey) }, ["t"] = { "ToggleTermToggleAll", "Toggle terminals" }, ["m"] = { "lua require('harpoon.mark').add_file()", "Mark file" }, + ["s"] = { + name = "Session", + ["s"] = { "lua require('persistence').load()", "Load current directory" }, + ["l"] = { "lua require('persistence').load({ last = true })", "Load last session" }, + ["d"] = { "lua require('persistence').stop()", "Stop session" }, + }, } whichKey.setup(setup)