3 ms·
It’s not enough. You should go all the way: set nobackup set nowritebackup set noundofile set noswapfile I explain why at https://lee-phillips
by leephillips 6y ago
It’s not enough. You should go all the way:
set nobackup
set nowritebackup
set noundofile
set noswapfile
I explain why at https://lee-phillips.org/badvim/ https://lee-phillips.org/badvim/
Also, it’s best to just have one instance of Vim running, in server mode, so you can send files to it from the command line.
- bananicorn 6y agoWhy would you not just set the location of the backup and swapfiles to a fixed place in your system? Try this: set backupdir=~/.vim/backups,. set directory=~/.vim/swapfiles,. It will only write in the current directory, if ~/.vim/backups does not exist, and the dot is just there for portability, so nothing breaks when using my vimrc on a new system. Edit: Upon actually reading your blog-post, I understand at least one reason - my options may not change the behaviour of a file not being written to the correct inode, so you have a point for some build systems. I actually learned rather much reading this, thank you for sharing!
- leephillips 6y agoIn fact, I think your idea is better, and I’ll probably switch to doing that some day, just in case one of these files turns out to save me. Edit: Hmmm. I’ll have to think some more about it. Anyway, glad you found my witeup useful.
- nemetroid 6y agoYou should end your swapfile directory setting with two slashes, i.e.: set directory=~/.vim/swapfiles//,. From the help text for "directory": > For Unix and Win32, if a directory ends in two path separators "//", the swap file name will be built from the complete path to the file with all path separators replaced by percent '%' signs (including the colon following the drive letter on Win32). This will ensure file name uniqueness in the preserve directory.
- rendall 6y agoI laughed at the poetry of the line "I don’t really want Vim to litter my filesystem with all of these piles of nervous energy." Truth
- rendall 6y agoI was still thinking about this today. "I have all these receipts everywhere..."
- leephillips 6y agoI’m glad this made an impression in you! (I know what you mean about the receipts.)
- kzrdude 6y agoPersistent undo is one of the best features in Vim. On any permanent working environment, I would definitely enable it. My undo files are in ~/.cache/