I often see that fonts intended to be used on Windows are defined with :cANSI
.
set guifont=Consolas:h11:cANSI
The help is, of course, provide some explanation, but I don't really understand it.
cXX - character set XX. Valid charsets are: ANSI, ARABIC, BALTIC, CHINESEBIG5, DEFAULT, EASTEUROPE, GB2312, GREEK, HANGEUL, HEBREW, JOHAB, MAC, OEM, RUSSIAN, SHIFTJIS, SYMBOL, THAI, TURKISH and VIETNAMESE. Normally you would use "cDEFAULT".
Examples:
:set guifont=courier_new:h12:w5:b:cRUSSIAN
:set guifont=Andale_Mono:h7.5:w4.5
Here is my vimrc:
if has('multi_byte')
if &encoding !~? '^u'
if &termencoding == ''
let &termencoding = &encoding
endif
set encoding=utf-8
endif
setglobal fileencoding=utf-8
set fileencodings=ucs-bom,utf-8,cp1251,latin1
endif
" set guifont=Consolas:h11:cANSI
" set guifont=Consolas:h11
" set guifont=Consolas:h11:cRUSSIAN
I can use :h11:cANSI
, just :h11
, or :h11:cRUSSIAN
, and I don't see any difference.
What is the reason to use :cANSI
or :cRUSSIAN
? Maybe this is something that was necessary in older versions of Vim only?
set guifont=Consolas:h11:cRUSSIAN
with a clean vimrc, for example, doesn't provide a possibity to see Russian characters, such as д or ф.&encoding
is not Unicode one. For example, until very late Vim for Windows used default charset (i.e.set enc=cp1251
for Russian locale). Then cRUSSIAN charset forguifont
will be required.set encoding=cp1251 guifont=Consolas:h11
with Vim 8.2.2824 and this works perfectly fine even without charset. (Thanks anyway.)