Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set font to be DejaVu Sans Mono in vim for xp?

Tags:

vim

i have installed vim for xp ,there is a file _vimrcin C:\Vim ,i have set font in _vimrc :

set guifont=Bitstream_Vera_Sans_Mono:h11:cANSI

when i open vim ,the setup can not work ,when i open gvim ,the setup can work . what is the matter? the configuration i write in _vimrc can work perfectly in gvim when i open it ,why it can not work in vim? In my gvim and cmd ,i can see Bitstream_Vera_Sans_Mono font in screen ,and my active console code page is set to be 437, vim can't use Bitstream_Vera_Sans_Mono font ,why?

like image 695
showkey Avatar asked Nov 16 '13 05:11

showkey


1 Answers

In $MYVIMRC, add the line:

set guifont=DejaVu\ Sans\ Mono:h11

...where :h11, specifies a height of 11 points.

N.B: A _ can be used in the place of a space, so you don't need to use backslashes to escape the spaces.

Reference

  • :help 'guifont'

Notes, following update to question

'guifont' only works on Vim's GUI (i.e. gvim) and not on a console (or terminal) vim instance. Vim has no control over the font of the terminal in which it is running.

If you wish to change the Windows XP(!) console font, see How to change the Windows XP console font? on SuperUser.

like image 165
Johnsyweb Avatar answered Sep 29 '22 08:09

Johnsyweb