Skip to content

Instantly share code, notes, and snippets.

@ajitid
Created June 21, 2022 09:11
Show Gist options
  • Save ajitid/382304f8cc000ce4ebec1c0007410196 to your computer and use it in GitHub Desktop.
Save ajitid/382304f8cc000ce4ebec1c0007410196 to your computer and use it in GitHub Desktop.
Persistent undo
if has("persistent_undo")
let target_path = stdpath('data') . '/.undodir'
" create the directory and any parent directories
" if the location does not exist.
if !isdirectory(target_path)
call mkdir(target_path, "p", 0700)
endif
let &undodir=target_path
set undofile
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment