Skip to content
WarWithinMe edited this page Dec 21, 2011 · 2 revisions

xVim supports a simplified version of vim key-remapping

How to:

  1. Find out xVim.bundle(~/Library/Application Support/SIMBL/Plugins/xVim.bundle), inside "./Contents/Resources", create a text file called "keymap"

  2. Edit the "keymap"(~/Library/Application Support/SIMBL/Plugins/xVim.bundle/Contents/Resources/keymap) using the rules described below.

  3. Relauch XCode.

Rules :

(There're some key mappings defined in "keymap-example" file)

  1. Each line contains a 'key mapping'. Each 'key mapping' contains {mode}<Space>{lhs}<Space>{rhs}

  2. '{mode}' can be i, n, r. (insert mode, normal mode, replace mode)

  3. '{lhs}' and '{rhs}' are key sequence.

Example:
i jk <Esc> // In insert mode, map jk to Esc. // That is if a user types in jk, xVim will consider that the user is typing Esc key.

i <C-S-Up> <Esc>yyphi // In insert mode, Ctrl+Shift+Up is map to <Esc>yyphi (copy a line above).

Special keys:
<Esc> // Esc key
<BS> // Backspace
<Tab> // Tab
<CR> // Carriage Return
<Enter> // Numeric pad enter
<Space> // Space
<Up> <Down> <Left> <Right> // Arrow keys
<F1> - <F12> // Fkeys
<Insert> <Del> <Home> <End> <PageUp> <PageDown>

Modifiers:
<C-a> // Control + a
<D-a> // Command + a
<M-a> // Alternate + a
<S-A> // Shift + a
They can also be combined like:
<C-D-S-A> // Control + Command + Shift + a.
notice that if the modifier has a Shift, the character should be in uppercase
i.e. <S-a> is wrong and should be changed to <S-A>

Other notes:

  1. Keys won't do second mapping. For example, you have specified:
    i jk h
    i dh l
    If you type djk, it won't becomd l(djk->dh->dl). Instead, it will become dh (djk->dh)