diff options
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/mbyte.txt | 4 | ||||
-rw-r--r-- | runtime/doc/message.txt | 6 | ||||
-rw-r--r-- | runtime/doc/options.txt | 28 | ||||
-rw-r--r-- | runtime/doc/vim_diff.txt | 2 |
4 files changed, 16 insertions, 24 deletions
diff --git a/runtime/doc/mbyte.txt b/runtime/doc/mbyte.txt index 8189ec5b38..c959c12fb4 100644 --- a/runtime/doc/mbyte.txt +++ b/runtime/doc/mbyte.txt @@ -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' is read-only after startup because changing it 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. diff --git a/runtime/doc/message.txt b/runtime/doc/message.txt index 7d674ae4d7..a17eee4976 100644 --- a/runtime/doc/message.txt +++ b/runtime/doc/message.txt @@ -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 + +You tried to set an option after startup that only allows changes during +startup. + ============================================================================== 3. Messages *messages* diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 1393b11824..13e01a8e3f 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -2217,21 +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 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 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). + 'encoding' cannot be changed after startup, because (1) it causes + non-ASCII text inside Vim to become invalid, and (2) it complicates + runtime logic. The recommended 'encoding' is "utf-8". Remote plugins + and GUIs only support utf-8. See |multibyte|. The character encoding of files can be different from 'encoding'. This is specified with 'fileencoding'. The conversion is done with @@ -2242,7 +2231,8 @@ A jump table for the options with a short description can be found at |Q_op|. if has("multi_byte_encoding") < 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 you set this option, it fires the |EncodingChanged| autocommand event so that you can set up fonts if necessary. @@ -2254,12 +2244,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 diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index 8f88906e38..52146cd946 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -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* |