Last active
October 13, 2021 18:03
-
-
Save mawkler/9c7d872c069e2ce5b2902a9ffad44ac4 to your computer and use it in GitHub Desktop.
Functions for zooming in GUI versions of Vim/Neovim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Increases the font size with `amount` | |
function! Zoom(amount) abort | |
call ZoomSet(matchstr(&guifont, '\d\+$') + a:amount) | |
endfunc | |
" Sets the font size to `font_size` | |
function ZoomSet(font_size) abort | |
let &guifont = substitute(&guifont, '\d\+$', a:font_size, '') | |
endfunc | |
noremap <silent> <C-+> :call Zoom(v:count1)<CR> | |
noremap <silent> <C--> :call Zoom(-v:count1)<CR> | |
noremap <silent> <C-0> :call ZoomSet(11)<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment