27

I know I can set fonts for gvim using something like set guifont=Menlo\ Regular:h14. I have the following questions

  1. Is there a wiki where I can see what all fonts are supported?
  2. I want to set my font to "Lucida Sans Typewriter". I tried set guifont=Lucida Sans Typewriter\ Regular:h14, but it gave me an error when I opened a file using gvim. Error is "E518: Unknown option: Sans"
  3. I also tried to increase the font size using set guifont=Sans\ Regular:h14, but looks like it is stuck at font size 11. I am trying this on macvim.
user376507
  • 2,004
  • 1
  • 19
  • 31

1 Answers1

52
  1. You need to backslash all of the spaces in the font name, not just the last one.

  2. You can :set guifont=* to open a font chooser with the fonts available on your system. Then after you pick one you like you can :set guifont? to read back the value you need to put in your .vimrc.

hobbs
  • 223,387
  • 19
  • 210
  • 288
  • Thank you. Point 1 works. However, I opened a gvim window and typed `:set guifont=*`, it did open a font chooser and I picked one. When I `set guifont=?` it says `E596: Invalid font(s): guifont=?`. – user376507 Feb 19 '14 at 22:57
  • @user376507 sorry, typo :) – hobbs Feb 19 '14 at 23:12
  • 2
    After choosing the font you like, you can edit your vimrc file (or your gvimrc file, if you have one) and, in Insert mode, enter `set guifont==&gfn`. (You will have to escape the spaces, or you could use `set guifont==escape(&gfn, ' ')`.) – benjifisher Feb 20 '14 at 01:50
  • Do the fonts have to be formally installed installed on Windows (I don't have admin rigths on my machine)? Or can they be in AppLocal somewhere? – GertVdE Oct 12 '18 at 08:18