Home Explore Blog CI



neovim

6th chunk of `runtime/doc/usr_45.txt`
fe7b65a8ee70ded61472c2ed1017f5030f0745782374ed980000000100000c61
 hundred thousand.  So how do
you type these characters?
   First of all, when you don't use too many of the special characters, you
can use digraphs.  This was already explained in |24.9|.
   When you use a language that uses many more characters than keys on your
keyboard, you will want to use an Input Method (IM).  This requires learning
the translation from typed keys to resulting character.  When you need an IM
you probably already have one on your system.  It should work with Vim like
with other programs.


KEYMAPS

For some languages the character set is different from latin, but uses a
similar number of characters.  It's possible to map keys to characters.  Vim
uses keymaps for this.
   Suppose you want to type Hebrew.  You can load the keymap like this: >

	:set keymap=hebrew

Vim will try to find a keymap file for you.  This depends on the value of
'encoding'.  If no matching file was found, you will get an error message.

Now you can type Hebrew in Insert mode.  In Normal mode, and when typing a ":"
command, Vim automatically switches to English.  You can use this command to
switch between Hebrew and English: >

	CTRL-^

This only works in Insert mode and Command-line mode.  In Normal mode it does
something completely different (jumps to alternate file).
   The usage of the keymap is indicated in the mode message, if you have the
'showmode' option set.  In the GUI Vim will indicate the usage of keymaps with
a different cursor color.
   You can also change the usage of the keymap with the 'iminsert' and
'imsearch' options.

To see the list of mappings, use this command: >

	:lmap

To find out which keymap files are available, in the GUI you can use the
Edit/Keymap menu.  Otherwise you can use this command: >

	:echo globpath(&rtp, "keymap/*.vim")


DO-IT-YOURSELF KEYMAPS

You can create your own keymap file.  It's not very difficult.  Start with
a keymap file that is similar to the language you want to use.  Copy it to the
"keymap" directory in your runtime directory.  For example, for Unix, you
would use the directory "~/.config/nvim/keymap".
   The name of the keymap file must look like this:

	keymap/{name}.vim ~
or
	keymap/{name}_{encoding}.vim ~

{name} is the name of the keymap.  Chose a name that is obvious, but different
from existing keymaps (unless you want to replace an existing keymap file).
{name} cannot contain an underscore.  Optionally, add the encoding used after
an underscore.  Examples:

	keymap/hebrew.vim ~
	keymap/hebrew_utf-8.vim ~

The contents of the file should be self-explanatory.  Look at a few of the
keymaps that are distributed with Vim.  For the details, see |mbyte-keymap|.


LAST RESORT

If all other methods fail, you can enter any character with CTRL-V:

	encoding   type			range ~
	8-bit	   CTRL-V 123		decimal 0-255
	8-bit	   CTRL-V x a1		hexadecimal 00-ff
	16-bit     CTRL-V u 013b	hexadecimal 0000-ffff
	31-bit	   CTRL-V U 001303a4	hexadecimal 00000000-7fffffff

Don't type the spaces.  See |i_CTRL-V_digit| for the details.

==============================================================================

Copyright: see |manual-copyright|  vim:tw=78:ts=8:noet:ft=help:norl:

Title: Keymaps, DIY Keymaps, and Last Resort Character Input
Summary
This section discusses how to use keymaps in Vim for typing languages with different character sets. It explains loading keymaps with ":set keymap=name" and using CTRL-^ to switch between languages in Insert and Command-line modes. It also covers how to create custom keymap files and where to save them. Finally, it describes using CTRL-V followed by decimal or hexadecimal values as a last resort method for entering any character, providing different formats depending on the encoding.