Change font size macvim?

Font SizeMacvim

Font Size Problem Overview


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!

Font Size Solutions


Solution 1 - Font Size

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.

Solution 2 - Font Size

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.

Solution 3 - Font Size

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

Solution 4 - Font Size

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

Solution 5 - Font Size

This works great my end.

:set guifont=Menlo\ Regular:h12

Solution 6 - Font Size

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

Solution 7 - Font Size

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    

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAlexView Question on Stackoverflow
Solution 1 - Font Sizeire_and_cursesView Answer on Stackoverflow
Solution 2 - Font SizeThorsten LorenzView Answer on Stackoverflow
Solution 3 - Font SizeDenisView Answer on Stackoverflow
Solution 4 - Font SizeConnerView Answer on Stackoverflow
Solution 5 - Font SizeJohn GriffithsView Answer on Stackoverflow
Solution 6 - Font SizesynthesizerpatelView Answer on Stackoverflow
Solution 7 - Font SizeJ4cKView Answer on Stackoverflow