Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why doesn't the font setting work in gvim?

Tags:

vim

fonts

In Fedora15, I was originally using vim, with all my settings defined in my ~/.vimrc file. I recently installed vim-X11, and have now transitioned to gvim. I defined a ~/.gvimrc file, with the following line to set the font:

set guifont=Bitstream_Vera_Sans_Mono:h11:cANSI

However, it doesn't work. There are two strange things:

  1. The other settings such as line number, color scheme works right, but font setting doesn't work. Instead, I need to set them in the tool bar every time to change the font: "Edit->Select Font".

  2. Every time I select "Edit -> Startup Settings", it opens the ~/.vimrc file instead of the ~/.gvimrc file.

like image 644
Tanky Woo Avatar asked Mar 23 '12 09:03

Tanky Woo


1 Answers

Your guifont is valid only on Windows. In GTK GVim, you want:

set guifont=Bitstream\ Vera\ Sans\ Mono\ 11

Also, you can use set guifont=* to bring up a system dialog to choose a font, and then look at the contents of the setting with set guifont?.

GVim loads .vimrc and then .gvimrc, so you can separate settings that apply only to GUI version.

like image 123
Cat Plus Plus Avatar answered Sep 19 '22 17:09

Cat Plus Plus