Alex
Alex

Reputation: 65942

Change font size macvim?

I'm using macvim and I love it. I also happen to really like the default font.

My question is:

How do I change the font size in my .gvimrc? I want it to be bigger, without changing the font from the default.

All the examples I've seen specify a font then a ':' then the size.

So how do I just change the size not the font itself?

Thanks!

Upvotes: 197

Views: 59260

Answers (7)

Denis
Denis

Reputation: 1239

None of the above answers worked for me, here is what worked out:

Add to your .gvimrc, for the janus users its ~/.gvimrc.after :

set guifont=Menlo\ Regular:h14

Upvotes: 76

Nivir
Nivir

Reputation: 31178

Changing the size in vim console font size can increase or decrease

set guifont=Menlo\ Regular:h14

For Macvim following key shortcut work

zoom out - CMD+-
zoom in -CMD+=

For Terminal

Zoom in-CMD/ctrl++
Zoom out-CMD/ctrl+-
Normal default size - CMD/cmd+0    

Upvotes: 6

Conner
Conner

Reputation: 31060

-= and -- will increase and decrease the font size, respectively.

Upvotes: 63

John Griffiths
John Griffiths

Reputation: 585

This works great my end.

:set guifont=Menlo\ Regular:h12

Upvotes: 11

synthesizerpatel
synthesizerpatel

Reputation: 28036

One useful note is missing from the responses - you can use set guifont=* which will bring up a font-picker for you to select from the available fonts on the system. It might be OSX and Linux only, but preferable to having to enter it manually.

Once you've selected the font, you can use set guifont again which will print out the name of the font and the size you've selected. The only caveat being that any spaces need to be backslashed in your ~/.vimrc

Upvotes: 9

Thorsten Lorenz
Thorsten Lorenz

Reputation: 11847

A quick way to set the font if you don't mind a menu popping up is to type :set gfn=*.

This will allow you to adjust any property of the font without changing anything else about it.

Then you can use :set gfn to see what it is now set to and add that to your .vimrc.

As an example, in my case it shows guifont=Monaco:h12 and so in order to get the same setting on startup, I added set gfn=Monaco:h12 to my .vimrc.

Upvotes: 125

ire_and_curses
ire_and_curses

Reputation: 70162

The default font is Bitstream Vera (search for 'default font' on that page). So why not just specify that, but with a different font size? E.g.

:set guifont=Bitstream\ Vera\ Sans\ Mono:h14

This approach also ensures that if in future the default changes (e.g. to the system default, Monaco), you will still have your preferred font enabled.

Upvotes: 147

Related Questions