Reputation: 1853
I frequently type :E
(uppercase) instead of :e
(lowercase) when I wish to open a file. Same goes for the mappings of :w[a]
and :q[a]
.
I thought I could fix that with the following in my .vimrc
:
cnoremap E e
cnoremap W w
...
They work by transforming the E into e, but sadly it also makes it harder to open/save a file with an uppercase E, the latter gets transformed to lowercase on the fly. To get the uppercase letter I know have to ctrl-v <letter> in C-mode
Is there a better method to help me with my common typos?
Upvotes: 2
Views: 148
Reputation: 195039
perhaps you can create a customized command W
, and forward the arguments to the real w
command:
command! -nargs=* -bang W w<bang> <args>
Upvotes: 3