1. Start vim and verify that undofile and undodir are setup 2. Add some contents to the new buffer 3. `:SudoWrite foo` 4. exit vim "foo" is missing from the undodir - no history has been written. You need to trigger a regular write (using `:w` for example) for the undofile being generated.