I wanted an easy way to resize the font in gvim (GTK), so I found this post:
Quickly switch between fonts at runtime
I created the following bindings based on that post:
let g:fc_list = [
\ "Inconsolata Semi-Condensed 11",
\ "Inconsolata Semi-Condensed 12",
\ "Inconsolata Semi-Condensed 13",
\ "Inconsolata Semi-Condensed 14",
\ "Inconsolata Semi-Condensed 15",
\ "Inconsolata Semi-Condensed 16",
\ ]
let g:fc_current = 3
let &guifont = g:fc_list[g:fc_current]
function! FontCycle(increment)
let g:fc_current = (g:fc_current + a:increment) % len(g:fc_list)
let &guifont = g:fc_list[g:fc_current]
redraw
endfunction
noremap ;- :call FontCycle(-1)<CR>
noremap ;= :call FontCycle(1)<CR>
noremap ;p :set guifont?<CR>
The bindings work great, but when the font size decreases white bars remain on the bottom and right of the screen. I tried redraw and clear, but neither worked. In case it's relevant: I use i3wm.
Does anyone know how to have the editor render properly, after changing the font size?

:h gtk-css– Christian Brabandt Jul 02 '20 at 12:29:set columns=999? – Ralf Jul 02 '20 at 17:30set lines=999I can almost fix the rows. It leaves just a couple of empty rows at the end, but it's workable like this. @Ralf you should turn your solution into an answer so that I can credit you with the solution. – Erik Lievaart Jul 03 '20 at 12:22