Reputation: 4728
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
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
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