Vim Chinese coding problem

Source: Internet
Author: User

1. Setting items that affect Chinese encoding

    • Encoding (ENC): encoding is the internal use of Vim code, encoding settings will affect the internal vim buffer, message text and so on. In a UNIX environment, the default setting for encoding is equal to the locale;windows environment and the current code page. The default setting for encoding in the Chinese Windows environment is cp936 (GBK).
    • FileEncoding (Fencs): Vim is saved when the new file is saved according to the fileencoding settings encoding. If you open an existing file, Vim saves it based on the encoding recognized when you open the file, unless you reset fileencoding on save.
    • Termencoding (TENC): When using VIM in a terminal environment, the encoding used by the Vim terminal is told by Termencoding Word.
    • Fileencodings (FENC): Vim will open the file according to the Fileencodings option to identify the file encoding, Fileencodings can set multiple encodings at the same time, Vim will be based on the order of settings to guess the encoding of the open file.

2. Set to support UTF-8

Set Encoding=utf-8

Note:

Set vim internal code to Utf-8

3. How to stay permanently active

First step: Create a configuration file

Touch/root/.vimrc

Step Two: Modify the configuration file

Set Encoding=utf-8

Note:

Vim-related configuration files

(1)

/etc/vimrc

(2)

/root/.viminfo

(3)

/root/.vimrc

Custom

Vim Chinese coding problem

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.