Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I set the default font size in Vim?

Tags:

vim

fonts

I am trying to configure the default settings for my GUI with Vim. I already made research on the web, but all the solutions I found and tried did not work.

Here are some of the things I tried (in the .vimrc file):

set guifont = Monaco:h20 set guifont=Monospace 20 

Actually I don't care about the Monaco font.

like image 960
Moebius Avatar asked Jul 07 '13 01:07

Moebius


People also ask

What font does Vim use?

Console Vim uses whatever font the console/terminal is using. Changing the font in your terminal is done differently depending on your system and the terminal in use.

How do I change the default font size in Konsole?

To change the font open menu Settings and select Edit Current Profile… Select Preview tab and change Text size value in the middle of the screen. Click Ok to confirm the new font.. Another option to change the font size is to press CTRL and Scroll Up/Down with mouse wheel.


1 Answers

For the first one remove the spaces. Whitespace matters for the set command.

set guifont=Monaco:h20 

For the second one it should be (the h specifies the height)

set guifont=Monospace:h20 

My recommendation for setting the font is to do (if your version supports it)

set guifont=* 

This will pop up a menu that allows you to select the font. After selecting the font, type

set guifont? 

To show what the current guifont is set to. After that copy that line into your vimrc or gvimrc. If there are spaces in the font add a \ to escape the space.

set guifont=Monospace\ 20 
like image 158
FDinoff Avatar answered Oct 08 '22 18:10

FDinoff