created February 16, 2008 · complexity basic · author Metacosm · version 7.0
In gvim, you can change the font using the Edit menu, Select Font. An alternative is to enter the command:
Once you have a font you like, you want to make it the default in the future. Do
and Vim will display something like
Make a note of this string. Now put a line in your vimrc to set guifont to this value, like this:
if has('gui_running') set guifont=Lucida_Console:h11 endif
Note: If there is a space in the text printed, such as
it will be necessary to escape the space
set guifont=Monospace\ 10
- Setting the font in the GUI details
Am keeping this as a simple form of VimTip632 for newcomers.
How about for console vimmers? :-(
- Console Vim uses whatever font your console/terminal is using. Changing the font in your terminal is done differently depending on your system and the terminal in use. Consult the documentation or manpages for your terminal, or do a web search for how to change the font in your chosen terminal. I believe Vim cannot use a different font than the rest of the terminal. --Fritzophrenic 15:25, July 25, 2011 (UTC)
- Indeed. When running inside a terminal, Vim can, at most, change the colours (within the limits of the colours supported by the terminal: sometimes bold and unbold black and white, often 8 colours plus bold/unbold foreground only [or seen another way, 8 background and 16 foreground]; on X11 some terminals support up to 256 background and foreground colours; "changing colours" usually also includes the use of reverse-video), and, if the terminal supports them (not all terminals do, and even those which do may support it only with certain fonts), use bold, underline and/or italic. — Tonymec 05:44, July 26, 2011 (UTC)
NOTE: setting the font in your $HOME\_vimrc file in Windows will disable the search highlighting.