5

As of late I often find a file named ..vimrc.un~ in the folder in which I edit a file. Where does this file come from?

I am using Vim 7.3 with plugins pathogen, nerdtree, vim-eunuch, vim-surround, vim-sparkup and vim-sensible.

Note: the reason I ask is because I don't know yet what particular component causes it. Otherwise I would be able to dig deeper or ask a more specific question.

1 Answer 1

6

Those files are used to store information for storing persistent undo information, allowing changes to be undone even after quitting and restarting vim. This is a builtin feature of vim, not from any plugin.

You can get additional information about this from within vim with:

:help undo-persistence
:help 'undofile'
:help 'undodir'
4
  • Which setting and/or command line switch prevents the behavior? Is this the same as -n? Thanks for the answer for now and +1 Mar 5, 2013 at 3:46
  • This is controlled by the undofile option, the second help section that I referenced. This is different than the swap files controlled by the -n option.
    – qqx
    Mar 5, 2013 at 4:00
  • Aaah, thanks. Means vim-sensible is the culprit and not so sensible for me after all ;) Mar 5, 2013 at 4:05
  • My issue is that I had set undodir=$HOME/.vimtmp/,. but that directory did not exist. So instead, it was putting the undofile right next to the original file.
    – St33lD13hl
    Jul 14, 2022 at 0:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .