You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
676 B

  1. let s:default_fontsize = 14
  2. let s:fontsize = s:default_fontsize
  3. let s:font = "Monospace"
  4. " GuiLinespace 2
  5. function! SetFont() abort
  6. if exists('g:GtkGuiLoaded')
  7. call rpcnotify(1, 'Gui', 'Font', s:font . ' ' . s:fontsize)
  8. else
  9. exec "GuiFont " . s:font . ":h" . s:fontsize
  10. endif
  11. endfunction
  12. call SetFont()
  13. function! AdjustFontSize(delta)
  14. let s:fontsize += a:delta
  15. call SetFont()
  16. endfunction
  17. function! ResetFontSize()
  18. let s:fontsize = s:default_fontsize
  19. call SetFont()
  20. endfunction
  21. nnoremap <C-=> :call AdjustFontSize(1)<CR>
  22. nnoremap <C-+> :call AdjustFontSize(1)<CR>
  23. nnoremap <C--> :call AdjustFontSize(-1)<CR>
  24. nnoremap <C-0> :call ResetFontSize()<CR>