In ubuntu (specifically ubuntu mate16.04) environment, the phenomenon of random code appears.
The test document is called “Chinese”
The terminal used is
As shown in the following figure, the Chinese display of vim terminal is normal.
Then vim with windowing appeared block-type random codes. The open command is
Right-click menu-open mode -vim
Try a solution
After searching Google many times, the solutions obtained were all revised.
vimrcThe encoding part of the document, individual
vimrcThe 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!
According to@dayaThe answer may be gvim font question, try in
~/.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.