Prevent splitting while in zoom (#3)

This commit is contained in:
Andrew Tomaka 2022-01-12 21:35:49 -05:00 committed by GitHub
parent c8b89f7679
commit 4915343011
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,13 +1,13 @@
call plug#begin('~/.vim/plugged') call plug#begin('~/.vim/plugged')
Plug 'chrisbra/matchit' Plug 'chrisbra/matchit'
Plug 'dhruvasagar/vim-zoom'
Plug 'junegunn/fzf' Plug 'junegunn/fzf'
Plug 'moll/vim-bbye' Plug 'moll/vim-bbye'
Plug 'ntpeters/vim-better-whitespace' Plug 'ntpeters/vim-better-whitespace'
Plug 'tpope/vim-eunuch' Plug 'tpope/vim-eunuch'
Plug 'tpope/vim-fugitive' Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-surround' Plug 'tpope/vim-surround'
Plug 'troydm/zoomwintab.vim'
" languages " languages
Plug 'tpope/vim-rails' Plug 'tpope/vim-rails'
@ -18,7 +18,7 @@ call plug#end()
" STATUS LINE " STATUS LINE
set statusline= set statusline=
set statusline+=%<\ %f%{ZoomState()} set statusline+=%<\ %f%{zoom#statusline()}
set statusline+=\ %m%r%y%w%= set statusline+=\ %m%r%y%w%=
set statusline+=\ Line:\ %l\/%L\ [%p%%] set statusline+=\ Line:\ %l\/%L\ [%p%%]
set statusline+=\ Col:\ %v set statusline+=\ Col:\ %v
@ -131,12 +131,17 @@ map <Leader>pu :PlugUpdate<cr>
let g:terraform_align=1 let g:terraform_align=1
" zoomwintab.vim " zoomwintab.vim
nnoremap <C-w>z :ZoomWinTabToggle<CR> nmap <C-w>z <Plug>(zoom-toggle)
nnoremap <C-w><C-z> :ZoomWinTabToggle<CR> nmap <C-w><C-z> <Plug>(zoom-toggle)
function! ZoomState() let g:zoom#statustext='Z'
if exists('t:zoomwintab') function! MyCtrlW()
return 'Z' let char = nr2char(getchar())
else
return '' if get(t:, 'zoomed', 0) == 1
if char is# 'v' || char is# 's' || char is# '' || char is# ''
return ""
endif endif
end
return "\<C-w>".char
endfunction endfunction
nnoremap <expr> <C-w> MyCtrlW()