levi
levi

Reputation: 22697

Vim is not creating .swp files

I was working in vim and my OS(Mac OS X El Capitan) crashed.

I tried to recover from .swp files created by vim (usually). But, I noticed that vim is not creating them. I already setup swap/backup directories but not luck.

Btw: Im using this well-know vim config (https://github.com/amix/vimrc)

Upvotes: 0

Views: 470

Answers (2)

Philip Kearns
Philip Kearns

Reputation: 419

I had a similar problem where Vim wasn't challenging me when I was editing a file twice. It turned out that somewhere along the line I had an old version of that file's .swp file and it was creating a .swo file instead. I exited Vim, removed the old .swp file and when I re-edited the file in question it created the swap file with the .swp extension. If I tried to edit the file in another window it complained that a swap file already existed, as it should.

These alternative swap file names are discussed here.

Upvotes: 0

levi
levi

Reputation: 22697

I found the issue, IDK why but by default backups and swap mode are disabled if you use this well-know vim config ((https://github.com/amix/vimrc))

To fix it, just add these lines to your vim config file

set swapfile
set backup

Upvotes: 2

Related Questions