diff --git a/common/neovim/lua/keymap.lua b/common/neovim/lua/keymap.lua index b62a651..bdaaf61 100644 --- a/common/neovim/lua/keymap.lua +++ b/common/neovim/lua/keymap.lua @@ -32,6 +32,12 @@ local keymap = { [' n'] = "'Nn'[v:searchforward]", [' N'] = "'nN'[v:searchforward]", [''] = ':lua SynGroup()', + + ['s'] = "SessionToggleecho 'Persisting Session: ' .. g:persisting .. ' (' .. getcwd() .. ')'", + ['S'] = "SessionSaveecho 'Saved Session: ' .. getcwd()", + ['l'] = "SessionLoadecho 'Loaded Session: ' .. getcwd()", + ['L'] = "SessionLoadLastecho 'Loaded Last Session: ' .. getcwd()", + ['d'] = "SessionDeleteecho 'Deleted Session for cwd: ' .. getcwd()", }, -- terminal bindings diff --git a/common/neovim/lua/options.lua b/common/neovim/lua/options.lua index b273be9..72896a0 100644 --- a/common/neovim/lua/options.lua +++ b/common/neovim/lua/options.lua @@ -51,10 +51,10 @@ local options = { shortmess = 'filnxToOFIac', history = 1000, undofile = true, - undodir = vim.g.vimdir .. '/undo', + undodir = vim.fn.stdpath'data' .. '/undo', undolevels = 1000, undoreload = 1000, - spellfile = vim.g.vimdir .. '/spell/en.utf-8.add', + spellfile = vim.fn.stdpath'data' .. '/spell/en.utf-8.add', ignorecase = true, smartcase = true, incsearch = true, diff --git a/common/neovim/lua/plugins.lua b/common/neovim/lua/plugins.lua index bbcab19..f61425a 100644 --- a/common/neovim/lua/plugins.lua +++ b/common/neovim/lua/plugins.lua @@ -23,9 +23,10 @@ packer.startup(function() -- session management 'olimorris/persisted.nvim', config = function() - -- TODO: only load session if no arguments passed? + local should_autoload = #vim.v.argv == 1 require'persisted'.setup{ - autoload = true, + autoload = should_autoload, + autosave = should_autoload, } end },