Simon Jackson wrote:
I would like to increase/decrease the font size by one when i hold
down ctrl and scroll the wheel. is this possible?
It may be possible, but not easy, since the font size must be extracted from
the 'guifont' option, and the latter has 5 incompatible formats, viz. GTK+2,
kvim (obsolete, but some versions are still around), Photon, other-X11 and
other. Each version of gvim accepts only one of these, and some have the size
at the end, others have it in the middle, and for a few it can be either. So
you would need to:
(1) construct a function to:
(1a) extract the size from the 'guifont' depending on the current version and
platform;
(1b) increase or decrease the size by 10 (ten tenths of a point) for
other-X11, or by 1 (1pt) on other GUI flavours
(1c) reconstruct the new 'guifont' value
(2) make mappings for <C-MouseUp> and <C-MouseDown> to call said function with
an argument of +1 or -1
It would be much easier to directly edit the 'guifont' on the command-line,
using
:set guifont=<Tab>
where <Tab> means "hit the Tab key": when you hit <Tab>, Vim will fill in the
current value with escaping backslashes if and where needed; you can then edit
it in-place, then hit Enter to accept the changes or Esc to reject the changes.
Here are the possible formats:
has("gui_gtk2")
:set gfn=Andale\ Mono\ 11
11pt "Andale Mono"
has("gui_kde")
:set gfn=B&H\ LucidaTypewriter/9/-1/5/50/0/0/0/1/0
9pt "B&H LucidaTypewriter"
has("gui_photon")
:set gfn=Courier:s10
10pt Courier
has("x11") && !(has("gui_gtk2") || has("gui_kde") || has("gui_photon"))
:set gfn=-*-lucidatypewriter-medium-r-normal-*-*-95-*-*-m-*-*
9.5pt LucidaTypewriter
!has("x11")
:set gfn=Courier_New:h12:cDEFAULT
12pt "Courier New"
Best regards,
Tony.
--
Pity the meek, for they shall inherit the earth.
-- Don Marquis