VIM Application: The ultimate solution to Windows system Gvim/vim of various garbled (file, menu, prompt information)!

Source: Internet
Author: User

This method solves my Windows Gvim Chinese garbled problem (share with you),

This method references http://www.douban.com/note/145491549/

To view the encoding of a file:
: Echo &fileencoding

Vim has four options related to character encoding, encoding, fileencoding, Fileencodings, termencoding (the possible values for these options can be found in the VIM online assistance: Help Encoding-names), They have the following meanings:

Encoding:vim the character encoding used internally, including the buffer of Vim, menu text, message text, and so on.
Fileencoding:vim the character encoding of the currently edited file, Vim saves the file as a character encoding (regardless of whether the new file is the same).
Fileencodings:vim starts by detecting the character encoding of the file to be opened by the character encoding it lists, and fileencoding is set to the final detected character encoding. It is therefore best to place Unicode encoding at the top of this list, Latin1 Latin encoding to the last side.
The character encoding of the terminal (or the Console window of Windows) that the Termencoding:vim is working on. This option is not valid for the gVim of our common GUI mode under Windows, and for Vim of the console mode is the code page of the Windows console, and usually we do not need to change it.


It is best to use the English menu and tips, you can avoid the menu and prompt information (b,c section) of the settings
If you are using the English menu and prompts when installing Gvim, remove the option to support the local language.

Solve the Vim file garbled, open file garbled, menu, message garbled:
There are four options related to character encoding, encoding, fileencoding, Fileencodings, termencoding
Modified in Linux. VIMRC (in Win is _VIMRC)

The Windows system can also be used in vim menu items: Edit > Launch settings, open the _VIMRC file directly

A, "Set the code form for the file
Set Encoding=utf-8
Set Termencoding=utf-8
Set Fileencoding=utf-8
Set fileencodings=ucs-bom,utf-8,chinese,cp936

B, "Vim's menu garbled solution:
Also in the _VIMRC file, add the following command after the Chinese setting
SOURCE $VIMRUNTIME/delmenu.vim
SOURCE $VIMRUNTIME/menu.vim

C, "vim message garbled solution
Language Messages Zh_cn.utf-8

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.