-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gvimrc
33 lines (28 loc) · 910 Bytes
/
.gvimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
" GUI (neo)vim initialization
" ~/.gvimrc for vim
" ~/.config/nvim/ginit.vim for neovim
" enable mouse
set mouse=a
" enable system clipboard integration
set clipboard^=unnamed,unnamedplus
" enable a GUI scrollbar
if exists('GuiScrollBar')
GuiScrollBar 1
endif
" customize the GUI font
if exists(':GuiFont')
" default font
let s:fontsize = 13
let s:fontname = "Go Mono"
:execute "GuiFont! " . s:fontname . ":h" . s:fontsize
" resize font with ctrl-scrollwheel
" based on: https://stackoverflow.com/a/51424640
function! AdjustFontSize(amount)
let s:fontsize = s:fontsize + a:amount
:execute "GuiFont! " . s:fontname . ":h" . s:fontsize
endfunction
noremap <C-ScrollWheelUp> :call AdjustFontSize(1)<CR>
noremap <C-ScrollWheelDown> :call AdjustFontSize(-1)<CR>
inoremap <C-ScrollWheelUp> <Esc>:call AdjustFontSize(1)<CR>a
inoremap <C-ScrollWheelDown> <Esc>:call AdjustFontSize(-1)<CR>a
endif