I know that this is probably better to solve by not typing sloppily in the first place, but I just think it would be really nice to have.
Since I've used Vim for a while, the ;w
(I have mapped normal mode ;
to :
) is a bit of a reflex for me. However, what I dont like is that sometimes i type fast and that causes bad things to happen.
Take a look at my vimrc...
"""" Commenting out cmaps because cmap applies when e.g. typing in (/)-search mode
" " prevent common typos from actually writing files to disk
" cmap wq1 wq!
" cmap w1 w!
" cmap q1 q!
" cmap qa1 qa!
" cmap e1 e!
"
" cmap w; w
"
" cmap qw wq
" cmap qw! wq!
" cmap qw1 wq!
"
" " and more combinatorially exploding goodness for dealing with flubbing the
" " enter key
" cmap wq\ wq
" cmap wq1\ wq!
" cmap wq!\ wq!
" cmap w\ w
" cmap w1\ w!
" cmap w!\ w!
This goes on for 50 or so more lines.
They're all commented because cmap
applies when using /
to search. That's a dealbreaker.
And this doesnt even cover the cases where I write :w
and then happen to mash some special char after it, and this somehow causes vim to write the buffer into a file named after that character. Great way to lose some work.
Any ideas? This is gonna require me to edit vim source code isn't it...