This plugin for gvim adds the ability to change font size (and therefore window size too) using the same methods used in most web browsers, terminal emulators and some other graphical text editors.
In console Vim or Neovim the plugin exits and doesn’t do anything.
I may add Mac support if this plugin attracts any interest.
Mapping | Action |
---|---|
Ctrl + = | Increases text size |
Ctrl + - | Decreases text size |
Ctrl + 0 | Resets text to original size |
Ctrl + mousewheel | Increases/Decreases text size |
If you already have any of these keys mapped, your mappings will not be overridden. There are also a few limitations when using older Windows gvim versions. First, before v9.0 patch 1112 Ctrl + - will not work. Instead, Ctrl + =, = has been made the default. Second, the mousewheel mappings will not work if you’re using a version before v8.2 patch 5069.
If you don’t like these mappings, you can map your own in your .vimrc with:
nnoremap {LHS} <Plug>CfsPlus
nnoremap {LHS} <Plug>CfsMinus
nnoremap {LHS} <Plug>CfsOriginal
...where {LHS}
is the key combination you want.
Installation can be done via a plugin manager.
For vim-plug it’s:
Plug 'eggbean/resize-font.gvim'
If you don’t use a plugin manager you can just place the scripts change_font_*.vim
in…
~/.vim/plugin
on Linux, or…
%USERPROFILE%\vimfiles\plugin
on Windows.
This should work with all modern Unicode fonts but if you find one that doesn’t work tell me and I’ll modify the regex. This is only likely to occur with Windows.