Today, I use VIM to edit HTML pages in Centos7 and find Chinese garbled. So Baidu, found that everyone seems to be around why it will occur in Chinese garbled, but the solution is not very in place. Garbled is nothing more than character encoding, decoding way there is a problem, we need to find the Vim configuration file about the character encoding, that is, the VIMRC file. The point is, where is the VIMRC configuration file? most of the netizens did not mention.
It's pretty simple, actually.
1. In the Linux (my is CENTOS7) terminal input: Vim. See Vim's Welcome screen
Vim
2. Enter the command in command mode to see the path to the VIMRC configuration file
: Version
3. I am here system VIMRC file in/ETC/VIMRC, then
Vim/etc/vimrc
Added at the end of the VIMRC file
Set Encoding=utf-8set LANGMENU=ZH_CN. Utf-8language message ZH_CN. Utf-8set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1
Chinese garbled problem solved.
If you have any further questions, please refer to
[Vim] Vim edit Chinese garbled solutionhttps://www.douban.com/note/524520357/Getting Started with Vi/vim: where is VIMRC?http://easwy.com/blog/archives/where-is-vimrc/
Linux Vim editor in Chinese garbled