diff --git a/my_configs.vim b/my_configs.vim index f3be63e..7fc6c6f 100644 --- a/my_configs.vim +++ b/my_configs.vim @@ -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 wz :call WinZoomToggle()