-
Notifications
You must be signed in to change notification settings - Fork 0
/
gvimrc
66 lines (54 loc) · 2.4 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
" -----------------------------------------------------------------------------
" Matjaž's dotfiles Vim GUI configuration file
"
" Copyright (c) 2015-2017, Matjaž Guštin <[email protected]> matjaz.it
" This source code form is part of the "Matjaž's dotfiles" project and is
" subject to the terms of the BSD 3-clause license as expressed in the
" LICENSE.md file found in the top-level directory of this distribution and at
" http://directory.fsf.org/wiki/License:BSD_3Clause
" -----------------------------------------------------------------------------
" Text appearance -------------------------------------------------------------
" Text font.
" The fonts are tried in a sequence. The first one found will be used.
set guifont=Source\ Code\ Pro:h12,Menlo:h12,Inconsolata:h12,Consolas:h12
" Font size quick change.
if has("unix")
function! FontSizePlus ()
let l:gf_size_whole = matchstr(&guifont, '\( \)\@<=\d\+$')
let l:gf_size_whole = l:gf_size_whole + 1
let l:new_font_size = ' '.l:gf_size_whole
let &guifont = substitute(&guifont, ' \d\+$', l:new_font_size, '')
endfunction
function! FontSizeMinus ()
let l:gf_size_whole = matchstr(&guifont, '\( \)\@<=\d\+$')
let l:gf_size_whole = l:gf_size_whole - 1
let l:new_font_size = ' '.l:gf_size_whole
let &guifont = substitute(&guifont, ' \d\+$', l:new_font_size, '')
endfunction
else
function! FontSizePlus ()
let l:gf_size_whole = matchstr(&guifont, '\(:h\)\@<=\d\+$')
let l:gf_size_whole = l:gf_size_whole + 1
let l:new_font_size = ':h'.l:gf_size_whole
let &guifont = substitute(&guifont, ':h\d\+$', l:new_font_size, '')
endfunction
function! FontSizeMinus ()
let l:gf_size_whole = matchstr(&guifont, '\(:h\)\@<=\d\+$')
let l:gf_size_whole = l:gf_size_whole - 1
let l:new_font_size = ':h'.l:gf_size_whole
let &guifont = substitute(&guifont, ':h\d\+$', l:new_font_size, '')
endfunction
endif
if has("gui_running")
nmap <S-F12> :call FontSizeMinus()<CR>
nmap <F12> :call FontSizePlus()<CR>
endif
" Window ----------------------------------------------------------------------
" Increase size of GUI window as much as possible.
set lines=999 columns=999
" Maximize the GUI window on Windows.
" Note, the ~x works on Windows when the system language is English and may
" not work with different languages.
if has("win32")
autocmd GUIEnter * simalt ~x
endif