最近在使用vi编程时出现了文本名的问题

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
flyer
帖子: 13
注册时间: 2009-03-27 13:55

最近在使用vi编程时出现了文本名的问题

#1

帖子 flyer » 2009-09-26 22:45

这几次我经常遇见一种情况,在vi下写了一个程序保存后,再用vi打开这个程序,就出现问题了。如我vi 3.c 写完后再用vi 3.c 这时出现
E325: ATTENTION
Found a swap file by the name ".3.c.swp"
owned by: flyer dated: Sat Sep 26 22:34:25 2009
file name: ~flyer/3.c
modified: YES
user name: flyer host name: ubuntu
process ID: 7956
While opening file "3.c"
dated: Sat Sep 26 22:31:49 2009

(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 3.c"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file ".3.c.swp"
to avoid this message.

Swap file ".3.c.swp" already exists!
pen Read-Only, (E)dit anyway, (R)ecover, (D)elete it, (Q)uit, (A)bort:
请帮忙解决下如何操作可以不再出现这种问题。谢谢!
头像
md5xwl
帖子: 133
注册时间: 2008-10-29 22:16
联系:

Re: 最近在使用vi编程时出现了文本名的问题

#2

帖子 md5xwl » 2009-09-27 9:16

确记:
编辑完保存然后退出,:wq命令,
如果你只保存然后关闭窗口或切换了,没有用:q退出,就会有swp.文件

代码: 全选

苏老泉,二十七,始发愤,读书籍。彼既老,犹悔迟。尔小生,宜早思!!
回复