I find that when I type Chinese characters (encoded with UTF-8) into VIM, I cannot see them at all while they do exist there. I can copy and paste them into other text editors and it seems everything is fine. How can I fix this problem?
Asked
Active
Viewed 9,729 times
2 Answers
4
you are not using a font which contains the glyphs needed to display the characters you typed.
so, choose the right font via
:set guifont=*
or
:set guifontwide=*
which would pop up a font-selection-dialog. and once you have a working font make it permanent by putting
set guifont=YOURFONT
to your .gvimrc / .vimrc
akira
- 63,447
4
Open the VIM configuration file
$ sudo -H gedit /etc/vim/vimrc
Added following lines:
set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
set termencoding=utf-8
set encoding=utf-8
Save and exit, and terminal command:
$ source /etc/vim/vimrc
At this time VIM will correctly display Chinese.