encoding: update docs for encoding

Helped-By: Michael Reed <m.reed@mykolab.com>
Helped-By: Justin M. Keyes <justinkz@gmail.com>
This commit is contained in:
Björn Linse 2015-08-29 16:13:39 +02:00
parent fa5827b144
commit e99368104a
4 changed files with 17 additions and 22 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
encoding. Not only the text in the buffers, but also in registers, variables,
etc. This also means that changing the value of 'encoding' makes the existing
text invalid! The text doesn't change, but it will be displayed wrong.
etc. 'encoding' cannot be changed after startup (at latest when |vimrc|
is sourced) as changing the value later would make the existing text invalid.
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.

View File

@ -739,6 +739,12 @@ Example: >
You tried to execute a command that is neither an Ex command nor
a user-defined command.
*E905* >
Cannot set this option after startup
This option might only be changed in a |vimrc| file (or earlier). This means
that plugins can rely on the value being constant after initialization.
==============================================================================
3. Messages *messages*

View File

@ -2217,21 +2217,13 @@ 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
with. See |encoding-names| for the possible values.
NOTE: Changing this option will not change the encoding of the
existing text in Vim. It may cause non-ASCII text to become invalid.
It should normally be kept at its default value, or set when Vim
starts up. See |multibyte|. To reload the menus see |:menutrans|.
This option cannot be changed after startup.
Otherwise it would cause non-ASCII text inside Vim to become
invalid. It should normally be kept at its default value, or be set
in vimrc. See |multibyte|.
This option cannot be set from a |modeline|. It would most likely
corrupt the text.
NOTE: For GTK+ 2 it is highly recommended to set 'encoding' to
"utf-8". Although care has been taken to allow different values of
'encoding', "utf-8" is the natural choice for the environment and
avoids unnecessary conversion overhead. "utf-8" has not been made
the default to prevent different behavior of the GUI and terminal
versions, and to avoid changing the encoding of newly created files
without your knowledge (in case 'fileencodings' is empty).
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'.
This is specified with 'fileencoding'. The conversion is done with
@ -2243,6 +2235,7 @@ A jump table for the options with a short description can be found at |Q_op|.
<
Normally 'encoding' will be equal to your current locale. This will
be the default if Vim recognizes your environment settings.
"utf-8" is used when the locale encoding could not be detected.
When you set this option, it fires the |EncodingChanged| autocommand
event so that you can set up fonts if necessary.
@ -2254,12 +2247,6 @@ A jump table for the options with a short description can be found at |Q_op|.
For example "Latin-1" becomes "latin1", "ISO_88592" becomes
"iso-8859-2" and "utf8" becomes "utf-8".
Note: "latin1" is also used when the encoding could not be detected.
This only works when editing files in the same encoding! When the
actual character set is not latin1, make sure 'fileencoding' and
'fileencodings' are empty. When conversion is needed, switch to using
utf-8.
When "unicode", "ucs-2" or "ucs-4" is used, Vim internally uses utf-8.
You don't notice this while editing, but it does matter for the
|viminfo-file|. And Vim expects the terminal to use utf-8 too. Thus

View File

@ -74,6 +74,8 @@ are always available and may be used simultaneously in separate plugins. The
'p')) mkdir() will silently exit. In Vim this was an error.
3. mkdir() error messages now include strerror() text when mkdir fails.
'encoding' cannot be changed after startup.
==============================================================================
4. New Features *nvim-features-new*