shaw.y.wang
shaw.y.wang

Reputation: 9

"set guifont" only works in Normal mode, not in vimrc

I'd like to set my gvim font into a monospaced font such as "sarasa mono". After I had typed ":set guifont=等距更纱黑体_Slab_SC_Semibold:h14:W600:cGB2312:qDRAFT", It worked fine, but in _vimrc (set guifont=等距更纱黑体_Slab_SC_Semibold:h14:W600:cGB2312:qDRAFT), it didn't.

By the way, it was annoying to see the "^M" on Windows, I edit my files both on Windows and Mac a lot. Is there anyone had met simular issue? Thanks a lot

enter image description here

set fenc=gbk
vmap <C-c> "+yi
vmap <C-x> "+c
vmap <C-v> c<ESC>"+p
imap <C-v> <C-r><C-o>+
set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936,big5
set fileencoding=utf-8
set encoding=utf-8
" set guifont=Monaco:h12
" set guifont=等距更纱黑体\ Slab\ SC\ Light:h18
set guifont=等距更纱黑体\ Slab\ SC\:h18
" set guifont=等距更纱黑体\ Slab\ SC\ Semibold:h18
" set guifont=*
" set gfw=隶书:h12:cGB2312
" set gfw=YaHei_Mono:h12.5:cGB2312
" set guifont=Fangsong:b:h14

Upvotes: 0

Views: 169

Answers (1)

shaw.y.wang
shaw.y.wang

Reputation: 9

I have fixed it by setting the variable "fileencoding" and "encoding" back to "gbk", then the command in vimrc "set guifont=等距更纱黑体_Slab_SC_Semibold:h14:W600:cGB2312:qDRAFT" worked.

Upvotes: 1

Related Questions