vi in ​​linux displays garbled Chinese characters

王林
Release: 2020-02-14 14:45:23
Original
4334 people have browsed it

vi in ​​linux displays garbled Chinese characters

Cause analysis:

Because the default is gb encoding under windows, and my vim defaults to utf-8 (gedit defaults to utf-8), so open It will become gibberish. Just modify the configuration file so that vi supports gb encoding.

(Online learning video sharing: linux video tutorial)

The specific method is as follows:

$vi ~/.vimrc 
let &termencoding=&encoding 
set fileencodings=utf-8,gbk 
$:wq
Copy after login

Open vi again, and the display will be normal.

Related recommendations: linux tutorial

The above is the detailed content of vi in ​​linux displays garbled Chinese characters. 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