Last active
January 22, 2024 11:24
-
-
Save markscottwright/3e231990e2a794d354697a3849b84b22 to your computer and use it in GitHub Desktop.
How to zoom in and out in linux gvim
This file contains hidden or 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
nmap <C-S-+> :call ZoomIn()<cr> | |
nmap <C-_> :call ZoomOut()<cr> | |
function! ZoomIn() | |
let font_name=&guifont | |
let font_parts=split(font_name) | |
if len(font_parts) > 1 | |
let font_size=str2nr(font_parts[1]) | |
if font_size!=0 && font_size<64 | |
let font_name=font_parts[0] . " " . (font_size + 2) | |
let &guifont=font_name | |
endif | |
endif | |
endfunction | |
function! ZoomOut() | |
let font_name=&guifont | |
let font_parts=split(font_name) | |
if len(font_parts) > 1 | |
let font_size=str2nr(font_parts[1]) | |
if font_size>4 | |
let font_name=font_parts[0] . " " . (font_size - 2) | |
let &guifont=font_name | |
endif | |
endif | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment