let s:pattern = '^\(.* \)\([1-9][0-9]*\)$' let s:minfontsize = 6 let s:maxfontsize = 16 function! AdjustFontSize(amount)

 if has("gui_gtk2") && has("gui_running")
   let fontname = substitute(&guifont, s:pattern, '\1', )
   let cursize = substitute(&guifont, s:pattern, '\2', )
   let newsize = cursize + a:amount
   if (newsize >= s:minfontsize) && (newsize <= s:maxfontsize)
     let newfont = fontname . newsize
     let &guifont = newfont
   echoerr "You need to run the GTK2 version of Vim to use this function."


function! LargerFont()

 call AdjustFontSize(1)

endfunction command! LargerFont call LargerFont()

function! SmallerFont()

 call AdjustFontSize(-1)

endfunction command! SmallerFont call SmallerFont()

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.