Fix session handling
This commit is contained in:
parent
adacb5c6c0
commit
c59fc57dd4
|
@ -32,6 +32,12 @@ local keymap = {
|
|||
['<expr> n'] = "'Nn'[v:searchforward]",
|
||||
['<expr> N'] = "'nN'[v:searchforward]",
|
||||
['<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
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
},
|
||||
|
|
Reference in a new issue