chrisbra/SudoEdit.vim — Issue #9: Automatically call `:rundo`
Author: seanfarley
Created: 2011-12-06 21:10:21+00:00
State: open

Reading the [docs](http://vimdoc.sourceforge.net/htmldoc/undo.html#:rundo) for `:rundo` it seems something similar could be added to plugin/SudoEdit.vim:

```viml
au BufReadPost * call ReadUndo()
au BufWritePost * call WriteUndo()
func ReadUndo()
if filereadable(expand('%:h'). '/UNDO/' . expand('%:t'))
rundo %:h/UNDO/%:t
endif
endfunc
func WriteUndo()
let dirname = expand('%:h') . '/UNDO'
if !isdirectory(dirname)
call mkdir(dirname)
endif
wundo %:h/UNDO/%:t
endfunc
```

But changing the paths for the user's `undodir` variable