Linux Vim editor in Chinese garbled

Source: Internet
Author: User

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

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.