vim
:recover 1.txt
# 出现如下提示按下回车即可恢复,如果有多个版本需要输入对应的交换文件前的数字选择要恢复的版本。Using swap file ".1.txt.swp"
Original file "~/test/1.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)
You may want to delete the .swp file now.
或者
vim -r 1.txt
可视模式
在普通模式下输入 v(小写),进入字符选择模式,就可以移动光标,光标走过的地方就会选取。再次按下 v 后就会取消选取。
在普通模式下输入 Shift+v(小写),进入行选择模式,按下 V 之后就会把整行选取,您可以上下移动光标选更多的行,同样,再按一次 Shift+v 就可以取消选取。