Remove Swap file path.swp already exists

by Francis 2014-02-12 10:27:45

Remove Swap file path.swp already exists

In open source operating system, we faced swap file already exists when we edit in vim/vi, and display like
[O]pen Read-Only, (E)dit anyway, (R)ecover, (D)elete it, (Q)uit, (A)bort:

Solution
First you can Delete (press "D")
And then reopen the same files.

Example:
E325: ATTENTION
Found a swap file by the name "/etc/.hosts.swp"
owned by: root dated: Tue Feb 4 12:12:05 2014
file name: /private/etc/hosts
modified: YES
user name: root host name: jfx
process ID: 2802
While opening file "/etc/hosts"
dated: Sat Feb 1 10:09:34 2014

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

Swap file "/etc/.hosts.swp" already exists!
[O]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (D)elete it:

2459
like
0
dislike
0
mail
flag

You must LOGIN to add comments