How can I see the option in Vim to “[D]elete” a swap file?
When I open a file for which Vim sees that there is a swap file present, it warns me and gives me some options, like "[A]bort" and "[E]dit anyways". However, one option it used to show me but no longer does is to "[D]elete" the swap file. How can I get it to show this option again?
vim swapfile
add a comment |
When I open a file for which Vim sees that there is a swap file present, it warns me and gives me some options, like "[A]bort" and "[E]dit anyways". However, one option it used to show me but no longer does is to "[D]elete" the swap file. How can I get it to show this option again?
vim swapfile
add a comment |
When I open a file for which Vim sees that there is a swap file present, it warns me and gives me some options, like "[A]bort" and "[E]dit anyways". However, one option it used to show me but no longer does is to "[D]elete" the swap file. How can I get it to show this option again?
vim swapfile
When I open a file for which Vim sees that there is a swap file present, it warns me and gives me some options, like "[A]bort" and "[E]dit anyways". However, one option it used to show me but no longer does is to "[D]elete" the swap file. How can I get it to show this option again?
vim swapfile
vim swapfile
asked Nov 13 '18 at 15:19
meiselmeisel
6771125
6771125
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
As posted on the vi stack exchange site by Martin Tournoij:
The "Delete it" option isn't displayed if the Vim process is still running; I can't find this documented anywhere but I looked it up in the source code; from memline.c
, line 4512 (slightly simplified):
do_dialog(
[..]
process_still_running
? (char_u *)_("&Open Read-Onlyn&Edit anywayn&Recovern&Quitn&Abort") :
(char_u *)_("&Open Read-Onlyn&Edit anywayn&Recovern&Delete itn&Quitn&Abort"), [..]);
The swap file embeds the process ID which created it, and if a process with that PID still exists it considers the process to be "running".
The swap message should display this information:
E325: ATTENTION
Found a swap file by the name "~/.vim/tmp/swap/swapy.swp"
owned by: martin dated: Fri Sep 8 22:13:35 2017
file name: ~martin/swapy
modified: no
user name: martin host name: arch.arp242.net
process ID: 17355 (still running)
While opening file "swapy"
dated: Fri Sep 8 22:13:35 2017
Note the process ID: 17355 (still running)
line.
The most likely scenario is that you have another Vim instance running somewhere :-) You could kill
it if you can't find it.
There is a small chance that the PID got re-used by another process though, in which case your only option is to quit Vim, manually remove the swap file, and restart it again:
$ rm ~/.vim/tmp/swap/swapy.swp
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53284125%2fhow-can-i-see-the-option-in-vim-to-delete-a-swap-file%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
As posted on the vi stack exchange site by Martin Tournoij:
The "Delete it" option isn't displayed if the Vim process is still running; I can't find this documented anywhere but I looked it up in the source code; from memline.c
, line 4512 (slightly simplified):
do_dialog(
[..]
process_still_running
? (char_u *)_("&Open Read-Onlyn&Edit anywayn&Recovern&Quitn&Abort") :
(char_u *)_("&Open Read-Onlyn&Edit anywayn&Recovern&Delete itn&Quitn&Abort"), [..]);
The swap file embeds the process ID which created it, and if a process with that PID still exists it considers the process to be "running".
The swap message should display this information:
E325: ATTENTION
Found a swap file by the name "~/.vim/tmp/swap/swapy.swp"
owned by: martin dated: Fri Sep 8 22:13:35 2017
file name: ~martin/swapy
modified: no
user name: martin host name: arch.arp242.net
process ID: 17355 (still running)
While opening file "swapy"
dated: Fri Sep 8 22:13:35 2017
Note the process ID: 17355 (still running)
line.
The most likely scenario is that you have another Vim instance running somewhere :-) You could kill
it if you can't find it.
There is a small chance that the PID got re-used by another process though, in which case your only option is to quit Vim, manually remove the swap file, and restart it again:
$ rm ~/.vim/tmp/swap/swapy.swp
add a comment |
As posted on the vi stack exchange site by Martin Tournoij:
The "Delete it" option isn't displayed if the Vim process is still running; I can't find this documented anywhere but I looked it up in the source code; from memline.c
, line 4512 (slightly simplified):
do_dialog(
[..]
process_still_running
? (char_u *)_("&Open Read-Onlyn&Edit anywayn&Recovern&Quitn&Abort") :
(char_u *)_("&Open Read-Onlyn&Edit anywayn&Recovern&Delete itn&Quitn&Abort"), [..]);
The swap file embeds the process ID which created it, and if a process with that PID still exists it considers the process to be "running".
The swap message should display this information:
E325: ATTENTION
Found a swap file by the name "~/.vim/tmp/swap/swapy.swp"
owned by: martin dated: Fri Sep 8 22:13:35 2017
file name: ~martin/swapy
modified: no
user name: martin host name: arch.arp242.net
process ID: 17355 (still running)
While opening file "swapy"
dated: Fri Sep 8 22:13:35 2017
Note the process ID: 17355 (still running)
line.
The most likely scenario is that you have another Vim instance running somewhere :-) You could kill
it if you can't find it.
There is a small chance that the PID got re-used by another process though, in which case your only option is to quit Vim, manually remove the swap file, and restart it again:
$ rm ~/.vim/tmp/swap/swapy.swp
add a comment |
As posted on the vi stack exchange site by Martin Tournoij:
The "Delete it" option isn't displayed if the Vim process is still running; I can't find this documented anywhere but I looked it up in the source code; from memline.c
, line 4512 (slightly simplified):
do_dialog(
[..]
process_still_running
? (char_u *)_("&Open Read-Onlyn&Edit anywayn&Recovern&Quitn&Abort") :
(char_u *)_("&Open Read-Onlyn&Edit anywayn&Recovern&Delete itn&Quitn&Abort"), [..]);
The swap file embeds the process ID which created it, and if a process with that PID still exists it considers the process to be "running".
The swap message should display this information:
E325: ATTENTION
Found a swap file by the name "~/.vim/tmp/swap/swapy.swp"
owned by: martin dated: Fri Sep 8 22:13:35 2017
file name: ~martin/swapy
modified: no
user name: martin host name: arch.arp242.net
process ID: 17355 (still running)
While opening file "swapy"
dated: Fri Sep 8 22:13:35 2017
Note the process ID: 17355 (still running)
line.
The most likely scenario is that you have another Vim instance running somewhere :-) You could kill
it if you can't find it.
There is a small chance that the PID got re-used by another process though, in which case your only option is to quit Vim, manually remove the swap file, and restart it again:
$ rm ~/.vim/tmp/swap/swapy.swp
As posted on the vi stack exchange site by Martin Tournoij:
The "Delete it" option isn't displayed if the Vim process is still running; I can't find this documented anywhere but I looked it up in the source code; from memline.c
, line 4512 (slightly simplified):
do_dialog(
[..]
process_still_running
? (char_u *)_("&Open Read-Onlyn&Edit anywayn&Recovern&Quitn&Abort") :
(char_u *)_("&Open Read-Onlyn&Edit anywayn&Recovern&Delete itn&Quitn&Abort"), [..]);
The swap file embeds the process ID which created it, and if a process with that PID still exists it considers the process to be "running".
The swap message should display this information:
E325: ATTENTION
Found a swap file by the name "~/.vim/tmp/swap/swapy.swp"
owned by: martin dated: Fri Sep 8 22:13:35 2017
file name: ~martin/swapy
modified: no
user name: martin host name: arch.arp242.net
process ID: 17355 (still running)
While opening file "swapy"
dated: Fri Sep 8 22:13:35 2017
Note the process ID: 17355 (still running)
line.
The most likely scenario is that you have another Vim instance running somewhere :-) You could kill
it if you can't find it.
There is a small chance that the PID got re-used by another process though, in which case your only option is to quit Vim, manually remove the swap file, and restart it again:
$ rm ~/.vim/tmp/swap/swapy.swp
answered Nov 13 '18 at 15:29
jeremysprofilejeremysprofile
1,6431517
1,6431517
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53284125%2fhow-can-i-see-the-option-in-vim-to-delete-a-swap-file%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown