Home Explore Blog CI



neovim

5th chunk of `runtime/doc/usr_45.txt`
02b48cd0eb0f1ab0f3885bd7226caf9b4671bfdc545b295a0000000100000876
 conversion available.


FORCING AN ENCODING

If the automatic detection doesn't work you must tell Vim what encoding the
file is.  Example: >

	:edit ++enc=koi8-r russian.txt

The "++enc" part specifies the name of the encoding to be used for this file
only.  Vim will convert the file from the specified encoding, Russian in this
example, to 'encoding'.  'fileencoding' will also be set to the specified
encoding, so that the reverse conversion can be done when writing the file.
   The same argument can be used when writing the file.  This way you can
actually use Vim to convert a file.  Example: >

	:write ++enc=utf-8 russian.txt
<
	Note:
	Conversion may result in lost characters.  Conversion from an encoding
	to Unicode and back is mostly free of this problem, unless there are
	illegal characters.  Conversion from Unicode to other encodings often
	loses information when there was more than one language in the file.

==============================================================================
*45.5*	Entering language text

Computer keyboards don't have much more than a hundred keys.  Some languages
have thousands of characters, Unicode has over 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,

Title: Forcing Encoding and Entering Language Text
Summary
This section details how to manually specify the encoding of a file in Vim using the ":edit ++enc=" command, especially when automatic detection fails. It also covers using the same argument with the ":write" command for file conversion. It then transitions to inputting language text, discussing digraphs and the use of Input Methods (IMs) for languages with large character sets. Finally, it introduces keymaps for languages with character sets that differ from Latin but use a similar number of characters, using Hebrew as an example and showing how to load a keymap with ":set keymap=hebrew".