I find my directories littered with files named ;
(semicolon) because I keep pressing :w;
by accident. What's the easiest way to prevent this?
Asked
Active
Viewed 51 times
0

dan
- 43,914
- 47
- 153
- 254
-
You can prevent this by paying attention to what you do. – romainl Feb 24 '16 at 19:42
-
@romainl : who never makes this kind of mistake, when often working on C-style files? – yolenoyer Feb 24 '16 at 19:45
-
People who pay attention to what they do. – romainl Feb 24 '16 at 19:55
-
1@romainl : It seems that vim's abbreviations were partly but explicitly created for people who do not always "pay attention" : please look at the example in `:h :abbreviate-verbose` – yolenoyer Feb 24 '16 at 20:13
1 Answers
4
You can use the following:
:cabbr w; w
This will correct occurences of "w;" with "w" inside the command line.
See :h abbreviations
for details.

yolenoyer
- 8,797
- 2
- 27
- 61
-
1Note: this will expand when searching as well. See [vim change :x function to delete buffer instead of save & quit](http://stackoverflow.com/q/7513380/438329) – Peter Rincker Feb 24 '16 at 22:10