Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am working on RedHat RHEL5. I want to change the font in GVIM.

The only font format that my GVIM accepts is

*-courier-medium-r-normal-*-*-140-*-*-m-*-*

It refuses to use Courier\ New or Courier_New names.

The default font is ugly and I wanted to change it to something prettier, like monospace font that I use in my terminal, but xfontsel does not show his font. set guifont=* neither works.

My questions are:

  1. How to "convince" GVIM to accept other system fonts

  2. Or, how to install additional fonts so they can be delivered to GVIM in -*-*-*- Morse code format

Edit

:set guifont=* gives error:

Font "*" is not fixed-width
Invalid font(s): guifont=*

To make the font selectable with xfontsel, additionally I had to use this trick:

xset fp+ ~/.fonts/  # maybe unnecessary
xset fp rehash
fc-cache
share|improve this question

2 Answers 2

up vote 1 down vote accepted

Take a look at this tutorial that shows how to install a custom font in your home directory, in a .fonts directory. The tutorial is titled: installing fonts in your home directory on Fedora 12.

Once a custom font has been installed here you can use the pull downs in gvim to change the font or run the command:

:set guifont=*

Which will bring up the dialog for selecting your font in gvim. See this tutorial on the Vim wiki for doing this as well and making them permanent.

I'd suggest the Proggy Fonts if you want something that looks good and fits nicely with doing development.

share|improve this answer
    
Thanks, I installed the font but I cannot set it in GVIM (edited question) –  Jakub M. Oct 15 '13 at 7:26
    
I had to to rehash and eventually it worked (described in my question) –  Jakub M. Oct 15 '13 at 7:43

As an alternative you can use vim in a terminal and set whatever font your terminal offers. The advantage is that you can then run the editor in a terminal multiplexer (e.g. tmux or screen) and connect to your editing session remotely.

share|improve this answer
    
well, I would not call it alternative, rather a default option :) It would be sufficient, but the terminal vim has ugly colour schemes (yes, I installed solarized etc, but my terminal refuses to run 256 colours for some reason) –  Jakub M. Oct 15 '13 at 20:51
    
What terminal do you use? The problem can bite you in other places as well, so it might be wise to spend some time on that. –  peterph Oct 15 '13 at 20:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.