Permanently Changing Your Graphical Vim Font
Copyright (C) 2005 by Steve Litt
The Problem
When using graphical Vim, the default font is usually not what you
want. Your combination of monitor, video card and resolution precludes
a one-size-fits-all font. You can set the font from the graphical Vim
menu, or even with a set gfn=
command, but that setting vanishes the moment you exit Vim. How do you
set it permanently?
The Procedure
The process of permanently changing your gvim font can be broken down
like this:
- Use the menu to find a suitable font
- Use set gfn? to find the text of that font
- Copy the font text into .gvimrc
- Backslash the spaces
Use the menu to find a suitable font
First, open graphical vim using the gvim command. Edit a file
convenient for evaluating fonts:
Now navigate the menu system to select a new font (Edit->Select
Font):
You'll be brought to the font selection dialog box:
Select a font with the ideal size, spacing and readability for your
system and needs:
In gvim, verify the
usability of the new font:
Use set gfn? to find the text of that font
Use the set gfn? command
to find the current font, which you set in the preceding step:
Copy the font text into .gvimrc
In response to the set gfn?
command you issued, vim returns the font as a string. Use Linux's copy
and paste mechanism to place that string into the Linux clipboard:
Edit the ~/.gvimrc file. Comment out any previous set gfn= commands, and then
paste your new font in. Add the word "set" in the beginning:
Backslash the Spaces
You're almost done. However, vim cannot process a multi-word font, so
spaces must be escaped with backslashes:
Now save your new ~/.gvimrc file. From now on your graphical Vim will
display the new font.
See also:
[ Linux Library
| Troubleshooters.Com
| Email Steve
Litt | Copyright
Notice ]
Copyright
(C)2005 by Steve Litt. -- Legal