ubuntu mate 16.04 vim(gvim? ) Chinese garbled code cannot be solved

  question, vim

Problem description

In ubuntu (specifically ubuntu mate16.04) environment, the phenomenon of random code appears.
The test document is called “Chinese”
The terminal used iszsh

As shown in the following figure, the Chinese display of vim terminal is normal.
vim终端显示正常

Then vim with windowing appeared block-type random codes. The open command isRight-click menu-open mode -vim
vim窗口显示不正常

Try a solution

After searching Google many times, the solutions obtained were all revised.vimrcThe encoding part of the document, individualvimrcThe settings are as follows:

set fileencodings=utf-8,gb2312,gb18030,gbk,ucs-bom,cp936,latin1
 set fileencoding=utf-8
 set encoding=utf-8

However, the problem still exists, please help solve it!


2016-07-26 11:04:41
According to@dayaThe answer may be gvim font question, try in/etc/vimgvimrcAnd~/.gvimrcAdd the following configuration to the file

set guifont=Sans serif 14¬
 "set guifont=Nimbus\ Mono\ L\ 14¬
 "set guifont=Bitstream\ Sans\ Mono\ 9¬
 set guifontwide=NSimsun\:h12  " Changes the fonts that can correctly show Chinese¬
 let $LANG ='zh_CN.UTF-8'¬

The problem cannot be solved.

1. That is not a windowed vim, but another terminal.
Confirmation method, input: ver, check whether the first line is gvim or vim.
2. There is a problem with the font configuration of this terminal. Please have ubuntu 16.04 students verify what terminal it is.
If you know what terminal it is, you will know how to modify the font configuration.
3. ubuntu does not install gvim by default, you need to install it manually.
sudo apt-get install gvim
Follow the prompts.