Fix session handling

This commit is contained in:
Daniel Flanagan 2022-03-09 13:37:25 -06:00
parent adacb5c6c0
commit c59fc57dd4
Signed by: lytedev
GPG key ID: 5B2020A0F9921EF4
3 changed files with 11 additions and 4 deletions

View file

@ -32,6 +32,12 @@ local keymap = {
['<expr> n'] = "'Nn'[v:searchforward]", ['<expr> n'] = "'Nn'[v:searchforward]",
['<expr> N'] = "'nN'[v:searchforward]", ['<expr> N'] = "'nN'[v:searchforward]",
['<c-m>'] = ':lua SynGroup()<cr>', ['<c-m>'] = ':lua SynGroup()<cr>',
['<leader>s'] = "<cmd>SessionToggle<cr><cmd>echo 'Persisting Session: ' .. g:persisting .. ' (' .. getcwd() .. ')'<cr>",
['<leader>S'] = "<cmd>SessionSave<cr><cmd>echo 'Saved Session: ' .. getcwd()<cr>",
['<leader>l'] = "<cmd>SessionLoad<cr><cmd>echo 'Loaded Session: ' .. getcwd()<cr>",
['<leader>L'] = "<cmd>SessionLoadLast<cr><cmd>echo 'Loaded Last Session: ' .. getcwd()<cr>",
['<leader>d'] = "<cmd>SessionDelete<cr><cmd>echo 'Deleted Session for cwd: ' .. getcwd()<cr>",
}, },
-- terminal bindings -- terminal bindings

View file

@ -51,10 +51,10 @@ local options = {
shortmess = 'filnxToOFIac', shortmess = 'filnxToOFIac',
history = 1000, history = 1000,
undofile = true, undofile = true,
undodir = vim.g.vimdir .. '/undo', undodir = vim.fn.stdpath'data' .. '/undo',
undolevels = 1000, undolevels = 1000,
undoreload = 1000, undoreload = 1000,
spellfile = vim.g.vimdir .. '/spell/en.utf-8.add', spellfile = vim.fn.stdpath'data' .. '/spell/en.utf-8.add',
ignorecase = true, ignorecase = true,
smartcase = true, smartcase = true,
incsearch = true, incsearch = true,

View file

@ -23,9 +23,10 @@ packer.startup(function()
-- session management -- session management
'olimorris/persisted.nvim', 'olimorris/persisted.nvim',
config = function() config = function()
-- TODO: only load session if no arguments passed? local should_autoload = #vim.v.argv == 1
require'persisted'.setup{ require'persisted'.setup{
autoload = true, autoload = should_autoload,
autosave = should_autoload,
} }
end end
}, },