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

巴扎黑
Release: 2017-08-22 13:26:37
Original
2661 people have browsed it

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
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template