- Mastering Vim
- Ruslan Osipov
- 225字
- 2021-06-10 18:51:25
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//
You can also choose to disable the swap files completely by adding set noswapfile to your .vimrc.
- 軟件架構設計:大型網站技術架構與業務架構融合之道
- Oracle從新手到高手
- Linux核心技術從小白到大牛
- Java高手真經(高級編程卷):Java Web高級開發技術
- Reactive Programming with Swift
- 樂高機器人設計技巧:EV3結構設計與編程指導
- RTC程序設計:實時音視頻權威指南
- HTML5從入門到精通 (第2版)
- Swift語言實戰精講
- 從Java到Web程序設計教程
- 零基礎看圖學ScratchJr:少兒趣味編程(全彩大字版)
- Tableau Desktop可視化高級應用
- Python Programming for Arduino
- 基于MATLAB的控制系統仿真及應用
- 產品架構評估原理與方法