Start to study the gvim configuration file (_ vimrc). now let's take a look at the configuration before I generate garbled characters. the meanings of enconding, fileeconding, and fileecondings in the configuration file are as follows:
Start to study the gvim configuration file (_ vimrc). now let's take a look at the configuration before I generate garbled characters. the meanings of enconding, fileeconding, and fileecondings in the configuration file are as follows:
Encoding: the character encoding method used inside gvim, including vim buffer, menu text, and message text.
In the user manual, it is recommended to change its value only in. vimrc. In fact, it seems only meaningful to change its value in. vimrc.
Fileencoding: the character encoding method of the file currently edited in gvim. when saving the file, vim also saves the file as this encoding method (whether new or not ).
Fileencodings: when gvim is started, it detects the character encoding methods of the files to be opened one by one based on the character encoding methods listed in it, and sets fileencoding as the final character encoding method.
Therefore, it is best to put the unicode encoding method at the beginning of this list, and put latin1 in the latin1.
Here: chinese is the cp963 encoding. I suddenly remembered that the default character set in my browser is gbk, and the encoding set in _ vimrc is UTF-8, which does not correspond to each other.
- Colors desert
- Set nobackup
- Set guifont = courier_new: h12: cansi
- "Garbled characters are displayed in the processed text.
- Set encoding = UTF-8
- Set fileencodings = chinese
- Set fileencoding = chinese
- "Process menu and context menu garbled characters
- Source $ vimruntime/delmenu. vim
- Source $ vimruntime/menu. vim
- "Handling consystemic output garbled characters
- Language messages zh_cn.utf-8
- Syntax enable
- Syntax on