how do I add a font in gVim on windows system

user18383 picture user18383 · Oct 25, 2008 · Viewed 22.7k times · Source

I wanted to add a UTF-8 font in Gvim but I could not find out how to do this. I tried to follow the step on this manual but it still did not work. http://www.inter-locale.com/whitepaper/learn/learn_to_type.html (vim section halfway the page)

Can anyone tell me how to add a font in Vim so I can have Japanese characters displayed ?

Answer

Zathrus picture Zathrus · Oct 28, 2008

As others note, you must use a fixed-width font. Vim is a text editor, not a WYSIWYG editor.

If you have a fixed-width font with the characters you need then:

:set guifont=*

Select the font you want to use, the size, etc. Once you're happy with it, do:

:set guifont?

And it will output the current setting of the value. Put the set guifont=foo in your .gvimrc (or in .vimrc with a if has("gui_running") block).

set guifont=<C-R>=&guifont<CR>

That will put the current value into the file.