官术网_书友最值得收藏!

A word about swap files

By default, Vim keeps track of the changes you make to files in swap files. The swap files are created as you edit the files, and are used to recover the contents of your files in case either Vim, your SSH session, or your machine crashes. If you don't exit Vim cleanly, you'll be greeted by the following screen:

You can either hit r to recover the swap file contents, or d to delete the swap file and dismiss the changes. If you decide to recover the swap file, you can prevent the same message from showing up next time you open the file in Vim by reopening a file and running :e, and pressing d to delete the swap file.

By default, Vim creates files like <filename>.swp and .<filename>.swp in the same directory as the original file. If you don't like your file system being littered by swap files, you can change this behavior by telling Vim to place all the swap files in a single directory. To do so, add the following to your .vimrc:

set directory=$HOME/.vim/swap//
If you're on Windows, you should use set directory=%USERDATA%\.vim\swap// (note the direction of the last two slashes).

You can also choose to disable the swap files completely by adding set noswapfile to your .vimrc.

主站蜘蛛池模板: 宜州市| 霍林郭勒市| 三江| 霍林郭勒市| 泗洪县| 辽源市| 冀州市| 泸水县| 松滋市| 余干县| 关岭| 旺苍县| 太仓市| 镇远县| 鱼台县| 宜君县| 海丰县| 高阳县| 金溪县| 汽车| 荆门市| 五台县| 汝阳县| 平罗县| 阜宁县| 满城县| 苏尼特左旗| 平利县| 黎城县| 永嘉县| 佳木斯市| 渝北区| 德阳市| 华坪县| 阳泉市| 唐海县| 清涧县| 北海市| 县级市| 定结县| 当雄县|