Home >Operation and Maintenance >Linux Operation and Maintenance >Solve the problem of Chinese garbled characters when using vim (vi) in Linux

Solve the problem of Chinese garbled characters when using vim (vi) in Linux

巴扎黑
巴扎黑Original
2017-08-22 13:26:372720browse

Solution to Chinese garbled characters using vim (vi) in Linux

Add the following two lines in the ~/.vimrc file:

set encoding=utf-8
set fileencoding=utf-8

Then the encoding in secureCRT is also set to utf- 8's. Just keep them consistent.

If you are using other terminal software, then also find the encoding settings and set it to utf-8.

Note: If there is no .vimrc file in the current user's root directory, create a new one and add the above two lines of configuration.

Modifying the .vimrc file in the current user's root directory is only valid for the current user. Modifying the /etc/vimrc file modifies the global configuration and is valid for all users. However, the prerequisite for modification is that you have modification permissions. .

The above is the detailed content of Solve the problem of Chinese garbled characters when using vim (vi) in Linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn