doc: 'encoding'

This commit is contained in:
Justin M. Keyes
2015-09-09 00:04:39 -04:00
parent 9468e53869
commit 3736a613e8
3 changed files with 10 additions and 13 deletions

View File

@@ -89,8 +89,8 @@ See |encoding-values| for a list of acceptable values.
The result is that all the text that is used inside Vim will be in this The result is that all the text that is used inside Vim will be in this
encoding. Not only the text in the buffers, but also in registers, variables, encoding. Not only the text in the buffers, but also in registers, variables,
etc. 'encoding' cannot be changed after startup (at latest when |vimrc| etc. 'encoding' is read-only after startup because changing it would make the
is sourced) as changing the value later would make the existing text invalid. existing text invalid.
You can edit files in another encoding than what 'encoding' is set to. Vim You can edit files in another encoding than what 'encoding' is set to. Vim
will convert the file when you read it and convert it back when you write it. will convert the file when you read it and convert it back when you write it.

View File

@@ -742,8 +742,8 @@ a user-defined command.
*E905* > *E905* >
Cannot set this option after startup Cannot set this option after startup
This option might only be changed in a |vimrc| file (or earlier). This means You tried to set an option after startup that only allows changes during
that plugins can rely on the value being constant after initialization. startup.
============================================================================== ==============================================================================
3. Messages *messages* 3. Messages *messages*

View File

@@ -2217,13 +2217,10 @@ A jump table for the options with a short description can be found at |Q_op|.
viminfo file, etc. It sets the kind of characters which Vim can work viminfo file, etc. It sets the kind of characters which Vim can work
with. See |encoding-names| for the possible values. with. See |encoding-names| for the possible values.
This option cannot be changed after startup. 'encoding' cannot be changed after startup, because (1) it causes
Otherwise it would cause non-ASCII text inside Vim to become non-ASCII text inside Vim to become invalid, and (2) it complicates
invalid. It should normally be kept at its default value, or be set runtime logic. The recommended 'encoding' is "utf-8". Remote plugins
in vimrc. See |multibyte|. and GUIs only support utf-8. See |multibyte|.
The recommended 'encoding' is "utf-8". Remote plugins and GUI:s
only support utf-8.
The character encoding of files can be different from 'encoding'. The character encoding of files can be different from 'encoding'.
This is specified with 'fileencoding'. The conversion is done with This is specified with 'fileencoding'. The conversion is done with
@@ -2234,8 +2231,8 @@ A jump table for the options with a short description can be found at |Q_op|.
if has("multi_byte_encoding") if has("multi_byte_encoding")
< <
Normally 'encoding' will be equal to your current locale. This will Normally 'encoding' will be equal to your current locale. This will
be the default if Vim recognizes your environment settings. be the default if Vim recognizes your environment settings, otherwise
"utf-8" is used when the locale encoding could not be detected. "utf-8" is used.
When you set this option, it fires the |EncodingChanged| autocommand When you set this option, it fires the |EncodingChanged| autocommand
event so that you can set up fonts if necessary. event so that you can set up fonts if necessary.