vim: add plugin 'mbbill/undotree' and persist undo history
This commit is contained in:
parent
e76710b5e1
commit
2adc719a87
2 changed files with 21 additions and 0 deletions
|
@ -15,6 +15,7 @@ o.pastetoggle = '<F20>' -- toggle paste with P on Moonlander
|
|||
o.swapfile = false -- don't use swap files
|
||||
o.writebackup = true -- Make a backup before writing a file...
|
||||
o.backup = false -- ...but don't keep it around.
|
||||
o.undofile = true -- write undo history
|
||||
|
||||
o.shortmess:append 'I' -- no intro message when starting Vim
|
||||
o.shada = {
|
||||
|
|
20
config/nvim/lua/user/plugins/undotree.lua
Normal file
20
config/nvim/lua/user/plugins/undotree.lua
Normal file
|
@ -0,0 +1,20 @@
|
|||
return {
|
||||
'mbbill/undotree',
|
||||
|
||||
init = function()
|
||||
vim.g.undotree_WindowLayout = 2 -- tree: left, diff: bottom
|
||||
vim.g.undotree_DiffAutoOpen = 0 -- don't open diff by default
|
||||
vim.g.undotree_SetFocusWhenToggle = 1
|
||||
|
||||
|
||||
vim.g.undotree_TreeNodeShape = ''
|
||||
vim.g.undotree_TreeVertShape = '│'
|
||||
vim.g.undotree_TreeSplitShape = '╱'
|
||||
vim.g.undotree_TreeReturnShape = '╲'
|
||||
end,
|
||||
|
||||
config = function()
|
||||
vim.keymap.set('n', '<leader>u', '<cmd>UndotreeToggle<cr>')
|
||||
end
|
||||
}
|
||||
|
Loading…
Add table
Reference in a new issue