junegunn / goyo.vim

:tulip: Distraction-free writing in Vim
MIT License
4.53k stars 118 forks source link

Goyo enter and exit does not remove tmux #271

Open vmuthuk2 opened 2 years ago

vmuthuk2 commented 2 years ago

I was using below code to hide tmux while inside Goyo which was working until I recently updated neovim to v0.8.0. Is there a fix for this?

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
  Limelight
  " ...
endfunction
junegunn commented 2 years ago

Did you setup autocmds as well?

vmuthuk2 commented 2 years ago

Yes, I use autocmd! User GoyoEnter nested call <SID>goyo_enter(). I have this issue on both Mac and Linux recently.

junegunn commented 2 years ago

What about the other lines of code in the function? (set ..., Limelight) Are they executed as expected?

vmuthuk2 commented 2 years ago

Sorry tmux is hidden inside Goyo but the lualine and tab bar of neovim is not hidden. Refer to figure below:

image
junegunn commented 2 years ago

Goyo doesn't know what lualine is. I can't update Goyo whenever a new statusline plugin comes into being. You have to call its API for disabling/enabling it on GoyoEnter and GoyoLeave.