程梁 写道:
> Thanks a lot for your help. What I want to get is that, turn off space or
> enter
> for expanding abbreviations and make other keys such as Ctrl+B do the same
> thing. Because I maybe define a lot abbreviations and I cannot map so much
> keys to an abbreviation. But thank you all the same.
>
> ------------------
> Cheng Liang
> 2008-12-30
> What you need is a mapping, not abbr, see :help map for that.
>
> for example:
>
> :imap <C-B> for (i=0; i<; i++) {<esc>7hi
>
> Would map something you like to Ctrl+B, Try and see.
I wonder whether you have tried my example or not, does it work for you?
Why you insist doing an abbreviation while mapping suits your need a lot
better? I don't think you need abbreviation at all, you can define lots
of mappings for that, and use leader mappings:
imap <Leader>ab abort
imap <Leader>cd switch () {<Left><Left><Left>
imap <Leader>ff for
inoremap <Leader>\ \
Note that <Leader> is actually the \ character, but if you use it for
mapping you may need to escape for itself. that is what the last mapping
do. And you can redefine the <Leader> character to anything else you want.
BTW: in vim mail list you should bottom post, i.e. write below the
quoted contents.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---