On 05/11/08 19:27, yosi izaq wrote:
> I often make the mistake of typing w1 instead of w!.
> Can you please suggest how to map w1 to w!?
>
> TIA
Depending what you want to achieve...
:cmap 1 !
would of course work, but I think it would have undesirable
side-effects. Otherwise, similarly to my previous answer,
command! -bar -nargs=? -complete=file -range=% w1
\ <line1>,<line2>w! <args>
or
if version< 700
cnoreabbrev w1 w!
else
cnoreabbrev <expr> w1
\ ((getcmdtype() == ':' && getcmdpos() <= 2)?
\ 'w!' : 'w1')
endif
but maybe the real solution would be to PaY mOre atTentiOn at hOw yOu
aRe hIttIng tHe sHifT kEy?
I guess I'm of that one of the members of that "old school" of thought
who regard the fact that a text editor, when you type "teh",
automatically corrects it to "the" without even asking, as doing (in the
long run) a disservice to the user, helping him not to learn orthography.
Best regards,
Tony.
--
Very few profundities can be expressed in less than 80 characters.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---