Using Mac's accent codes with Vim
Vim is something that make fell smart and productive. I completely avoided the context switch by using Vim on my daily basis that I can barely remember the time when I used to login on any server and fell completely defeated by vi.
But there was one thing that upset me about Vim: accentuation. Those damn diacritic who follows everyone who speaks a Latin derived language, for me and my fellows is Portuguese, but it also applies to French, Spanish or Italian.
If I had to write something in my arterial language I used switch back to TextEdit and use mac accent codes or even switch my keyboard to a layout that support and translate the sequence ‘a into á. This week I switched back to mutt just after facing a couple of issues with Mail.app. And the lack of support for diacritic in Vim was turning my mutt experience into something really painful.
After a couple of rants I realized I could use Vim digraphs to manage this issue and I simply had to patch my .vimrc to have those mac accent codes mapped to digraphs, so I did it.
imap ^[e <C-k>' imap ^[n <C-k>? imap ^[c <C-k>,c imap ^[i <C-k>> imap ^[` <C-k>! imap ^[u <C-k>:
But, when editing your .vimrc don’t simple copy and paste into configuration file because it won’t work. The ^[ is an escape sequence which needs a properly raw input. Hit control+v mac_accent_code after imap and before using the control-K digraph. After updating and reload your configuration just try input some mac accent codes. For example to insert an acute type option+e + vowel




