Reputation: 65942
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
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
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
Reputation: 31060
⌘-= and ⌘-- will increase and decrease the font size, respectively.
Upvotes: 63
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
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
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