Search code examples
vimkeymapping

How to load a pinyin.vim keymap in vim on Mavericks?


I am trying to get this pinyin keymap to load into vim.

I have placed this file into ~/.vim/keymap/pinyin.vim.

Questions

  1. How do I load this file automatically through a command in ~/.vimrc?
  2. How do I turn this mode on/off?
  3. How do I actually invoke these keymappings?

Answer

FDinoff's suggestion below is perfect. What I did on Mavericks was update to Snapshot 73 Vim 7.4.258, mv the old vim to /tmp and mv mvim to /usr/bin/mvim, create a symbolic link and I was all set.


Solution

  • This file is already part of the vim runtime so you don't need to include it yourself.

    You can change what keymap you are using by using set keymap=pinyin. You can turn it off with set keymap=

    To invoke the key mappings just type them literally in insert mode.

    So for example typing a2 will get you á

    Take a look at :h keycap (Note this feature requires vim has been compiled with the keymap feature)