Robin
Robin

Reputation: 1190

Why does Vim sometimes create .swp files?

Sometimes Vim creates a .swp file when I edit something, but not always. Why is that, and what causes Vim to create .swp files? Is it bad to disable them in .vimrc?

Upvotes: 5

Views: 1421

Answers (1)

Ami Tavory
Ami Tavory

Reputation: 76366

Vim creates .swp files for recovery. In case you fail to save, vim will be able to recover (at least some of) the file.

The merits of disabling them depends on what you do. If you use vim for anything that has a build, you probably save your sources all the time (how much time goes by between your coding stuff and compiling, building, and running a ut? Probably not hours). I hate the swps because they always require me to tell the version control system to ignore them.

Upvotes: 7

Related Questions