- 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.
- Kali Linux Web Penetration Testing Cookbook
- Java 開發從入門到精通(第2版)
- Microsoft Dynamics 365 Extensions Cookbook
- 無代碼編程:用云表搭建企業數字化管理平臺
- Android Development with Kotlin
- Rust編程從入門到實戰
- 深入淺出Android Jetpack
- PostgreSQL 11從入門到精通(視頻教學版)
- Flash CS6中文版應用教程(第三版)
- 數據結構與算法分析(C++語言版)
- Python深度學習:模型、方法與實現
- Mastering Web Application Development with AngularJS
- Python編程:從入門到實踐(第3版)
- Bootstrap for Rails
- Getting Started with Polymer