欢迎各位兄弟 发布技术文章
这里的技术是共享的
使用vi编辑器编辑文件时,经常会由于非正常退出而产生一个swp文件,以后每次进入时都会提示,非常麻烦。现将网上搜集的解决方法陈列于此:
vim -r help.txt Using swap file ".help.txt.swp" Original file "~/vim/runtime/doc/help.txt" Recovery completed. You should check if everything is OK. (You might want to write out this file under another name and run diff with the original file to check for changes) Delete the .swp file afterwards. 使用交换文件 ".help.txt.swp" 原文件 "~/vim/runtime/doc/help.txt" 恢复完成. 请确定一切正常. (你可能想要把这个文件另存为别的文件名, 再执行 diff 与原文件比较以检查是否有改变) 之后可以删除交换文件。 :write help.txt.recovered vimdiff main.c~ main.c+ +--123 lines: /* a|+ +--123 lines: /* a| <- 折叠 text | text | text | text | text | text | text | changed text | <- 修改过的行 text | text | text | ------------------| <- 删除的行 text | text | text | text | text | text |+ +--432 lines: text|+ +--432 lines: text| <- 折叠 ~ | ~ | ~ | ~ |main.c~==============main.c==============| | :edit main.c :vertical diffsplit main.c :edit main.c :vertical diffpatch main.c diff :set noscrollbind ]c [c :diffupdate :dp :do来自 https://blog.csdn.net/u012349696/article/details/50000429