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
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!