Browse Source

Add persistent undo history

Olivier Marty 7 years ago
parent
commit
7a1aca57fb
1 changed files with 9 additions and 0 deletions
  1. 9 0
      vimrc

+ 9 - 0
vimrc

@@ -17,3 +17,12 @@ set ruler
 set showcmd
 set background=dark
 set mouse=a
+
+" Keep undo history across sessions by storing it in a file
+if has('persistent_undo')
+    let myUndoDir = expand('$HOME/.vimundodir')
+    " Create dirs
+    call system('mkdir ' . myUndoDir)
+    let &undodir = myUndoDir
+    set undofile
+endif