file name: /tmp/vitest/man_db.conf
<==
这个暂
存
盘属
于哪
个实际
的
文件
?
modified: no
user name: dmtsai host name: study.centos.vbird
process ID: 31851
While opening file "man_db.conf"
dated: Mon Jul 6 23:47:21 2015
底下
说
明可能
发
生
这个错误
的
两个
主要原因与½
决
方案!
(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 man_db.conf"
to rec
over the changes (see ":help recovery").
If you did this already, delete the swap file ".man_db.conf.swp"
to avoid this message.
Swap file ".man_db.conf.swp" already exists!
底下
说
明你可
½
行的
动
作
[O]pen Read
-
Only, (E)dit anyway, (R)ecover, (D)elete it, (Q)u
it, (A)bort:
由于暂存盘存在的关系,因此
vim
会主动的判断你的这个文件可能有些问题,在上面的图示中
vim
提示两点主要的问题与½决方案,分别是这样的:
.
问题一:可能有其他人或程序同时在编辑这个文件:
由于
Linux
是多人多任务的环境,因此很可能有很多人同时在编辑同一个文件。如果在多人共同编辑的情
况下,
万一大家同时储存,那么这个文件的内容½会变的乱七八糟!为了避免这个问题,因此
vim
会出
现这个警告窗口!
½决的方法则是:
o
找到另外那个程序或人员,请他½该
vim
的工作½束,然后你再继续处理。
o
如果你只是要看该文件的内容并不会有任何修改编辑的行为,那么
可以选择开启成为只读
(O)
文件,
亦即上述画面反白部分输入英文『
o
』即可
,其实就是
[O]pen Read-Only
的选项啦!
.
问题二:在前一个
vim
的环境中,可能因为某些不知名原因导致
vim
中断
(crashed)
:
这就是常见的不正常½束
vim
产生的后果。½决方案依据不同的情况而不同喔!常见的处理方法为:
o
如果你之前的
vim
处理动作尚未储存,此时你应该要按下『
R
』,亦即使用
(R)ecover
的项目,
此
时
vim
会载入
.man_db.conf.swp
的内容,让你自己来决定要不要储存!这样就能够救回来你之前
未储存的工作。
不过那个
.man_db.conf.swp
并不会在你½束
vim
后自动删除,所以
你离开
vim
后
还得要自行删除
.man_db.conf.swp
才能避免每次打开这个文件都会出现这样的警告
!