Home Explore Blog CI



neovim

3rd chunk of `runtime/doc/mbyte.txt`
20baba6c9b12c59c83039049dc21bde376da0efd44fc61e00000000100000fa5
 |locale| name is "ko", do this:

    sh:    export LANG=ko
    csh:   setenv LANG ko

You can put this in your ~/.profile or ~/.cshrc file to always use it.

To use a locale in Vim only, use the |:language| command: >

	:language ko

Put this in your |init.vim| file to use it always.

Or specify $LANG when starting Vim:

   sh:    LANG=ko vim {vim-arguments}
   csh:	  env LANG=ko vim {vim-arguments}

You could make a small shell script for this.

==============================================================================
Encoding				*mbyte-encoding*

UTF-8 is always used internally to encode characters. This applies to all the
places where text is used, including buffers (files loaded into memory),
registers and variables.

							*charset* *codeset*
Charset is another name for encoding.  There are subtle differences, but these
don't matter when using Vim.  "codeset" is another similar name.

Each character is encoded as one or more bytes.  When all characters are
encoded with one byte, we call this a single-byte encoding.  The most often
used one is called "latin1".  This limits the number of characters to 256.
Some of these are control characters, thus even fewer can be used for text.

When some characters use two or more bytes, we call this a multibyte
encoding.  This allows using much more than 256 characters, which is required
for most East Asian languages.

Most multibyte encodings use one byte for the first 127 characters.  These
are equal to ASCII, which makes it easy to exchange plain-ASCII text, no
matter what language is used.  Thus you might see the right text even when the
encoding was set wrong.

							*encoding-names*
Vim can edit files in different character encodings.  There are three major groups:

1   8bit	Single-byte encodings, 256 different characters.  Mostly used
		in USA and Europe.  Example: ISO-8859-1 (Latin1).  All
		characters occupy one screen cell only.

2   2byte	Double-byte encodings, over 10000 different characters.
		Mostly used in Asian countries.  Example: euc-kr (Korean)
		The number of screen cells is equal to the number of bytes
		(except for euc-jp when the first byte is 0x8e).

u   Unicode	Universal encoding, can replace all others.  ISO 10646.
		Millions of different characters.  Example: UTF-8.  The
		relation between bytes and screen cells is complex.

Only UTF-8 is used by Vim internally.  But files in other
encodings can be edited by using conversion, see 'fileencoding'.

Recognized 'fileencoding' values include:		*encoding-values*
1   latin1	8-bit characters (ISO 8859-1, also used for cp1252)
1   iso-8859-n	ISO_8859 variant (n = 2 to 15)
1   koi8-r	Russian
1   koi8-u	Ukrainian
1   macroman    MacRoman (Macintosh encoding)
1   8bit-{name} any 8-bit encoding (Vim specific name)
1   cp437	similar to iso-8859-1
1   cp737	similar to iso-8859-7
1   cp775	Baltic
1   cp850	similar to iso-8859-4
1   cp852	similar to iso-8859-1
1   cp855	similar to iso-8859-2
1   cp857	similar to iso-8859-5
1   cp860	similar to iso-8859-9
1   cp861	similar to iso-8859-1
1   cp862	similar to iso-8859-1
1   cp863	similar to iso-8859-8
1   cp865	similar to iso-8859-1
1   cp866	similar to iso-8859-5
1   cp869	similar to iso-8859-7
1   cp874	Thai
1   cp1250	Czech, Polish, etc.
1   cp1251	Cyrillic
1   cp1253	Greek
1   cp1254	Turkish
1   cp1255	Hebrew
1   cp1256	Arabic
1   cp1257	Baltic
1   cp1258	Vietnamese
1   cp{number}	MS-Windows: any installed single-byte codepage
2   cp932	Japanese (Windows only)
2   euc-jp	Japanese
2   sjis	Japanese
2   cp949	Korean
2   euc-kr	Korean
2   cp936	simplified Chinese (Windows only)
2   euc-cn	simplified Chinese
2   cp950	traditional Chinese (alias for big5)
2   big5	traditional Chinese (alias for cp950)
2   euc-tw	traditional Chinese
2   2byte-{name} any double-byte encoding (Vim-specific name)
2   cp{number}	MS-Windows: any installed double-byte codepage
u   utf-8	32 bit UTF-8 encoded Unicode (ISO/IEC 10646-1)
u   ucs-2	16 bit UCS-2 encoded Unicode (ISO/IEC 10646-1)
u   ucs-2le

Title: Setting Locale in Vim and Character Encoding Details
Summary
The text describes how to set a locale within Vim, either by using the ':language' command in the init.vim file or by specifying the $LANG environment variable when starting Vim. It also explains character encoding, noting that Nvim internally uses UTF-8 for all text. It differentiates between single-byte and multibyte encodings, and lists recognized 'fileencoding' values. It categorizes encodings into 8-bit, 2-byte, and Unicode types.