0

I am learning how to use Vim. I likely exited the editor by pressing Ctrl+Z which made it "crash". I now keep on having problems with swap files of .vimrc. Because of that, e. g., I cannot change the colorscheme for the editor, even after I :w and :source ~/.vimrc.

How do I fix the old swaps problem?

1
  • 2
    I believe Vim didn't "crash" but went on sleep/background and holding the files. You can probably wake up it using the fg shell command. Commented Jan 10, 2023 at 10:01

1 Answer 1

0

The Ctrl-z key is supposed to move Vim into the background (the GUI is invisible, you are back to the shell).

But Vim is still running in the background and holding the swap files.

If you use the following shell command: fg Vim will moved into the foreground.

When you quit Vim using the Vim :q (or the strong :qa!) command the swap files should automatically be deleted.

3
  • Many thanks, this has helped, I've closed like a dozen of Vim instances.
    – Kolya
    Commented Jan 10, 2023 at 14:47
  • Thanks for the feedback :-) If this solved your problem maybe could you validate the answer using the green v button below to the voting arrows. Commented Jan 10, 2023 at 14:49
  • 1
    Sure, I've done that!
    – Kolya
    Commented Jan 10, 2023 at 14:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.