VIM TIP20

VimTip 20: Are .swp and ~ files littering your working directory?
清理swp、~文件

Have you ever been frustrated at swap files and backups cluttering up your working directory?
你曾有过被工作目录中的缓存文件swp和备份文件~所烦恼的时候嘛?
这就是一活生生的例子:
Untidy:
ons.txt
ons.txt~
README
README~
tester.py
tester.py~

Here are a couple of options that can help:
这是一些能够起到改善的选项:
set backupdir=./.backup,.,/tmp
set directory=.,./.backup,/tmp


This way, if you want your backups to be neatly grouped, just create a directory called '.backup' in your working directory.
这样,如果你想将你的备份文件整齐的分类,在工作目录中创建.backup的目录
Vim will stash backups there. The 'directory' option controls where swap files go. If your working directory is not writable,
Vim will put the swap file in one of the specified places.
Vim将在其中备份。directory选项控制缓存文件的位置。如果你的工作目录不是可写的,Vim将在一个给定的目录中放置缓存文件。

Technorati Tags: ,

评论