Change Vim swap/backup/undo file name

I have this in my .vimrc and it names the swap files with full path names and percent signs just as you describe: ” Store swap files in fixed location, not current directory. set dir=~/.vimswap//,/var/tmp//,/tmp//,. The key is the // at the end of the directories. See this note from :help dir: For Unix and … Read more

How to change the folder path for swp files in Vim

You can set the directory option to the location that you want vim to store its swap files, e.g.: mkdir -p $HOME/.vim/swapfiles # this dir must exist vi does not create it ” $HOME/.vimrc :set directory=$HOME/.vim/swapfiles// I use trailing double path separators because, from the help docs: For Unix and Win32, if a directory ends … Read more

Found a swap file by the name

Looks like you have an open git commit or git merge going on, and an editor is still open editing the commit message. Two choices: Find the session and finish it (preferable). Delete the .swp file (if you’re sure the other git session has gone away). Clarification from comments: The session is the editing session. … Read more