diff --git a/config/nvim/lua/user/options.lua b/config/nvim/lua/user/options.lua index c89886f..0833c15 100644 --- a/config/nvim/lua/user/options.lua +++ b/config/nvim/lua/user/options.lua @@ -15,6 +15,7 @@ o.pastetoggle = '' -- 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 = { diff --git a/config/nvim/lua/user/plugins/undotree.lua b/config/nvim/lua/user/plugins/undotree.lua new file mode 100644 index 0000000..1d94263 --- /dev/null +++ b/config/nvim/lua/user/plugins/undotree.lua @@ -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', 'u', 'UndotreeToggle') + end +} +