用类似vim ~/.config/user-dirs 编辑文件时,发现以下这些错误提示:
Found a swap file by the name “.install.log.swp”
owned by: root dated: Sat May 1 10:52:16 2010
file name: ~root/install.log
modified: no
user name: root host name: localhost.localdomain
process ID: 14389 (still running)
While opening file “install.log”
dated: Sat Jan 30 21:31:27 2010
(1) Another program may be editing the same file.
If this is the case, be careful not to end up with two
different instances of the same file when making changes.
Quit, or continue with caution.
(2) An edit session for this file crashed.
If this is the case, use “:recover” or “vim -r install.log”
to recover the changes (see “:help recovery”).
If you did this already, delete the swap file “.install.log.swp”
to avoid this message.
“install.log” 892L, 33018C
Press ENTER or type command to continue
原因是上次修改的文件不正常退出,导致在编辑这个文件时,出现同时打开的情况。我是直接删除了里面结尾为.swp的文件,然后没有出现提示,删除命令用rm+文件名。
参考 vim错误提示解决方法