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