feat(nvim): save folds between sessions
This commit is contained in:
parent
b34334fb56
commit
0aefa4729d
@ -12,6 +12,20 @@ M.setup = function()
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
command = "%s/\\s\\+$//e",
|
||||
})
|
||||
|
||||
-- NOTE: Remember folds
|
||||
vim.api.nvim_create_augroup("SaveFolds", { clear = true })
|
||||
vim.api.nvim_create_autocmd("BufWinLeave", {
|
||||
pattern = "*.*",
|
||||
command = "mkview",
|
||||
group = "SaveFolds"
|
||||
})
|
||||
vim.api.nvim_create_autocmd("BufWinEnter", {
|
||||
pattern = "*.*",
|
||||
command = "silent! loadview",
|
||||
group = "SaveFolds"
|
||||
})
|
||||
|
||||
end
|
||||
|
||||
return M
|
||||
|
Loading…
x
Reference in New Issue
Block a user