vim creates copies of my files after saving?

你。 提交于 2019-12-23 18:10:08

问题


HI there,

Using vim and whenever I make a change and save a file vim seems to create a backup file. I can see that it's the file before I made my change and saved. How can I prevent this or hide these files?

I type :wq to save and quit.


回答1:


Add set nobackup to your ~/.vimrc file.




回答2:


Yeak, preferably you should set sth like :

set backupdir=~/backup/vim
set dir=~/backup/vim/swap
set undodir=~/backup/vim/undos
set undofile
set bk

Note also the savevers plugin.

So you'll never have files in places you don't want, but keep the backup functionnality.



来源:https://stackoverflow.com/questions/5065226/vim-creates-copies-of-my-files-after-saving

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!