-
Notifications
You must be signed in to change notification settings - Fork 7
Simplified Key map
-
Find out xVim.bundle(~/Library/Application Support/SIMBL/Plugins/xVim.bundle), inside "./Contents/Resources", create a text file called "keymap"
-
Edit the "keymap"(~/Library/Application Support/SIMBL/Plugins/xVim.bundle/Contents/Resources/keymap) using the rules described below.
-
Relauch XCode.
(There're some key mappings defined in "keymap-example" file)
-
Each line contains a 'key mapping'. Each 'key mapping' contains
{mode}<Space>{lhs}<Space>{rhs}
-
'{mode}' can be i, n, r. (insert mode, normal mode, replace mode)
-
'{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>
- Keys won't do second mapping.
For example, you have specified:
i jk h
i dh l
If you typedjk
, it won't becomdl
(djk->dh->dl). Instead, it will becomedh
(djk->dh)