summary refs log tree commit diff
path: root/.vim/plugin/undo.lua
diff options
context:
space:
mode:
authorRobert Günzler <r@gnzler.io>2024-11-25 13:30:37 +0100
committerRobert Günzler <r@gnzler.io>2024-11-25 13:58:25 +0100
commit23de12baba9fbfc4ca24581b37c374aa5345cc25 (patch)
treee4b3c421bad572eb85a1089eaad44dc3059ab6e6 /.vim/plugin/undo.lua
parent18e3848110da0a59843058927ea04b496f5db2a5 (diff)
update nvim config
Signed-off-by: Robert Günzler <r@gnzler.io>
Diffstat (limited to '.vim/plugin/undo.lua')
-rw-r--r--.vim/plugin/undo.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/.vim/plugin/undo.lua b/.vim/plugin/undo.lua
new file mode 100644
index 0000000..aed6195
--- /dev/null
+++ b/.vim/plugin/undo.lua
@@ -0,0 +1,10 @@
+-- persistent undo
+
+local undodir = vim.fn.stdpath('cache') .. '/undodir'
+
+if vim.fn.isdirectory(undodir) == 0 then
+  vim.fn.mkdir(undodir, 'p', '0700')
+end
+
+vim.g.undodir = undodir
+vim.opt.undofile = true