Files
dotfiles/nvim/plugin-config/goyo.vim
2021-12-11 16:06:51 +01:00

31 lines
725 B
VimL

" Goyo
" https://github.com/junegunn/goyo.vim
function! s:goyo_enter()
if executable('tmux') && strlen($TMUX)
silent !tmux set status off
silent !tmux list-panes -F '\#F' | grep -q Z || tmux resize-pane -Z
endif
set noshowmode
set noshowcmd
set scrolloff=999
Gitsigns toggle_signs
endfunction
function! s:goyo_leave()
if executable('tmux') && strlen($TMUX)
silent !tmux set status on
silent !tmux list-panes -F '\#F' | grep -q Z && tmux resize-pane -Z
endif
set showmode
set showcmd
set scrolloff=8
Gitsigns toggle_signs
endfunction
autocmd! User GoyoEnter nested call <SID>goyo_enter()
autocmd! User GoyoLeave nested call <SID>goyo_leave()
" Mappings
noremap <leader>z :Goyo<CR>