Added some window height things

FIX: SetWinMinHeight no longer crashes when argument < 0
  FIX: <leader>- no longer crashes when already at winminheight=0
ADD: New command Equal makes all windows equally big (and sets
minwinheight to 0 in the process, use <leader>- to reset them)
This commit is contained in:
Talia 2017-10-26 08:49:54 +02:00
parent 399fdda6a3
commit e328b6724f
1 changed files with 11 additions and 2 deletions

9
vimrc
View File

@ -215,10 +215,19 @@ function! s:GrepOperator(type)
endfunction endfunction
" Window Height stuff " Window Height stuff
command! Equal call Equal()
function! Equal()
set winminheight=0
set winheight=1
set equalalways!
set equalalways!
endfunc
function! SetWinMinHeight(num) function! SetWinMinHeight(num)
execute "set winminheight=".0 execute "set winminheight=".0
if a:num>=0
execute "set winheight=".(a:num+1) execute "set winheight=".(a:num+1)
execute "set winminheight=".a:num execute "set winminheight=".a:num
endif
execute "set winheight=".9999 execute "set winheight=".9999
endfunc endfunc
call SetWinMinHeight(2) call SetWinMinHeight(2)