If you regularly switch to a larger or smaller font, for example because someone looking at your code thinks the letters are too small, or because you want to lay back in your chair while reading, this tip is for you.

The following script defines two commands, :LargerFont and :SmallerFont, to allow quick adjustments to the font size used in the gtk2 gui. Change minfontsize and maxfontsize to suit your needs. See below for alternative solutions.

To use this script, put the following code into ~/.vim/plugin/gtk2fontsize.vim or in your vimrc.

Another alternative is to use the following mappings which use a clever substitute (no functions are required). This example works using gvim under Windows, where the command :set guifont? would show the font name and :h12 if the font size is 12 points, for example.