Having the German Mac Keyboard Layout, it is a pain to type |
as it is bound to <A-7>
and it is hard for me to reach the Alt key.
Thus, I'd like to do the following remapping (exchanging the binding for |
开发者_C百科and 7
):
imap 7 <Bar>
imap <A-7> 7
The first one works, the second one does not. I have already tried all combinations with inor
(no remap) but wasn't successful.
Maybe I don't get the concept of remapping. Or I am missing something else.
In my experience, some re-mappings that involve modifiers simply don't work in MacVim. The two workarounds I use are:
Try a different modifier key, e.g. or
Use Keyboard Maestro (an excellent key mapper for Mac OS X) to do the re-mapping
I think the answer you're looking for is:
inoremap 7 <bar>
inoremap <bar> 7
I use similar bindings to swap my semicolon and colon usage (except mine are not for insert mode):
nnoremap ; :
nnoremap : ;
xnoremap ; :
xnoremap : ;
Updated as per Rory O'Kane's suggestion in comments (thanks!).
精彩评论