1
0
mirror of https://git.decapod.one/brethil/dotfiles synced 2024-11-22 03:21:30 +01:00

vim: add WinZoomToggle <leader>wz

This commit is contained in:
bretello 2020-03-09 17:58:39 +01:00
parent 8bb46eec61
commit bb3a47e282

View File

@ -110,3 +110,22 @@ highlight DiffText cterm=bold ctermfg=10 ctermbg=88 gui=none guifg=bg guibg=Re
" \ 'dir': '(dist|build)$',
" \ }
let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files -co --exclude-standard']
function! WinZoomToggle() abort
if ! exists('w:WinZoomIsZoomed')
let w:WinZoomIsZoomed = 0
endif
if w:WinZoomIsZoomed == 0
let w:WinZoomOldWidth = winwidth(0)
let w:WinZoomOldHeight = winheight(0)
wincmd _
wincmd |
let w:WinZoomIsZoomed = 1
elseif w:WinZoomIsZoomed == 1
execute "resize " . w:WinZoomOldHeight
execute "vertical resize " . w:WinZoomOldWidth
let w:WinZoomIsZoomed = 0
endif
endfunction
nnoremap <leader>wz :call WinZoomToggle()<CR>