drjrm3
drjrm3

Reputation: 4728

Why do I accidentally create files called ":wq"?

Sometimes when I am using vim, I find that I have accidentally created files called :wq or other commands I use internally from vim. In this case, it was a file which I was working on and I believe I saved this file as :wq somehow.

Has anyone ever experienced this and what accidental keystrokes am I making which does this?

I tend to use bash, but this happens regardless of the OS I am using.

Upvotes: 2

Views: 333

Answers (2)

Etan Reisner
Etan Reisner

Reputation: 81012

If you type :w :wq by accident or :w q you will create :wq and q files.

I often create a 2 file in a similar fashion

Upvotes: 3

Birei
Birei

Reputation: 36282

I think you write it twice, because the :w accepts a parameter as file name to save the buffer, like:

:wq :wq

Upvotes: 6

Related Questions