mappings
are being used. This is disabled by default, to avoid that the cursor becomes
invisible when you use a non-standard background color. Here is an example to
use a brightly colored cursor: >
:highlight Cursor guifg=NONE guibg=Green
:highlight lCursor guifg=NONE guibg=Cyan
<
*keymap-file-format* *:loadk* *:loadkeymap* *E105* *E791*
The keymap file looks something like this: >
" Maintainer: name <email@address>
" Last Changed: 2001 Jan 1
let b:keymap_name = "short"
loadkeymap
a A
b B comment
The lines starting with a " are comments and will be ignored. Blank lines are
also ignored. The lines with the mappings may have a comment after the useful
text.
The "b:keymap_name" can be set to a short name, which will be shown in the
status line. The idea is that this takes less room than the value of
'keymap', which might be long to distinguish between different languages,
keyboards and encodings.
The actual mappings are in the lines below "loadkeymap". In the example "a"
is mapped to "A" and "b" to "B". Thus the first item is mapped to the second
item. This is done for each line, until the end of the file.
These items are exactly the same as what can be used in a |:lmap| command,
using "<buffer>" to make the mappings local to the buffer.
You can check the result with this command: >
:lmap
The two items must be separated by white space. You cannot include white
space inside an item, use the special names "<Tab>" and "<Space>" instead.
The length of the two items together must not exceed 200 bytes.
It's possible to have more than one character in the first column. This works
like a dead key. Example: >
'a á
Since Vim doesn't know if the next character after a quote is really an "a",
it will wait for the next character. To be able to insert a single quote,
also add this line: >
'' '
Since the mapping is defined with |:lmap| the resulting quote will not be
used for the start of another character defined in the 'keymap'.
It can be used in a standard |:imap| mapping.
The "accents" keymap uses this. *keymap-accents*
The first column can also be in |<>| form:
<C-c> Ctrl-C
<A-c> Alt-c
<A-C> Alt-C
Note that the Alt mappings may not work, depending on your keyboard and
terminal.
Although it's possible to have more than one character in the second column,
this is unusual. But you can use various ways to specify the character: >
A a literal character
A <char-97> decimal value
A <char-0x61> hexadecimal value
A <char-0141> octal value
x <Space> special key name
The characters are assumed to be encoded in UTF-8.
It's possible to use ":scriptencoding" when all characters are given
literally. That doesn't work when using the <char-> construct, because the
conversion is done on the keymap file, not on the resulting character.
The lines after "loadkeymap" are interpreted with 'cpoptions' set to "C".
This means that continuation lines are not used and a backslash has a special
meaning in the mappings. Examples: >
" a comment line
\" x maps " to x
\\ y maps \ to y
If you write a keymap file that will be useful for others, consider submitting
it to the Vim maintainer for inclusion in the distribution:
<maintainer@vim.org>
HEBREW KEYMAP *keymap-hebrew*
This file explains what characters are available in UTF-8 and CP1255 encodings,
and what the keymaps are to get those characters:
glyph encoding keymap ~
Char UTF-8 cp1255 hebrew hebrewp name ~
א 0x5d0 0xe0 t a alef
ב 0x5d1 0xe1 c b bet
ג 0x5d2 0xe2 d g gimel
ד 0x5d3 0xe3 s d dalet
ה 0x5d4 0xe4 v h he
ו 0x5d5 0xe5 u v vav
ז 0x5d6 0xe6 z z zayin
ח 0x5d7 0xe7 j j het
ט 0x5d8 0xe8 y T tet
י 0x5d9 0xe9 h y yod
ך 0x5da 0xea l K kaf sofit
כ 0x5db 0xeb f k kaf
ל 0x5dc 0xec k l lamed
ם 0x5dd 0xed o