Streamline SetFontSize function for gvim

This commit is contained in:
Talia 2018-10-22 10:39:14 +02:00
parent 38c497474f
commit 697a90857c

21
gvimrc
View file

@ -41,25 +41,18 @@ if !exists('g:colors_name')
end end
end end
function! SetFont()
if exists("g:font_temp") && exists("g:font_size")
let &guifont=substitute(&guifont, g:font_temp, g:font_size, "g")
end
endfun
function! SetFontSize(size)
let g:font_size=a:size
call SetFont()
endfun
let s:fontsize = 13
if has("unix") if has("unix")
elseif has("win32") elseif has("win32")
let g:font_temp=".*:h\\zs\\d\\+" let g:font_temp=".*:h\\zs\\d\\+"
let g:font_size=s:fontsize
set linespace=0 set linespace=0
call SetFont()
end end
let s:fontsize = match(&guifont, "")
function! SetFontSize(size)
if exists("g:font_temp")
let &guifont=substitute(&guifont, g:font_temp, a:size, "g")
end
endfun
command! -nargs=1 SetFontSize call SetFontSize(<f-args>) command! -nargs=1 SetFontSize call SetFontSize(<f-args>)
command! ResetFontSize call SetFontSize(s:fontsize) command! ResetFontSize call SetFontSize(s:fontsize)