Open Jemoka opened 4 years ago
@Jemoka
Simplest solution (thus far) is to [...] disable/reenable the plugin at gogo_enter/gogo_leave
Did you get this to work? vim-airline-clock doesn't seem to have a toggle for enabling/disabling it at run-time, the closest setting I could find is let g:airline#extensions#clock#auto
which I couldn't get working with GoyoEnter
/GoyoLeave
since it doesn't quite do what's needed here.
@Melkster
@Jemoka
Simplest solution (thus far) is to [...] disable/reenable the plugin at gogo_enter/gogo_leave
Did you get this to work? vim-airline-clock doesn't seem to have a toggle for enabling/disabling it at run-time, the closest setting I could find is
let g:airline#extensions#clock#auto
which I couldn't get working withGoyoEnter
/GoyoLeave
since it doesn't quite do what's needed here.
Well... No. Unfortunately I just disabled the plugin entirely and used tmux('s clock). However, I have seen success of other folks somehow disabling the segment representing the clock in vim-airline.
I think I have a solution. The problem is the timer in vim-airline-clock
:
Calling [timer_pause
](https://vimhelp.org/eval.txt.html#timer_pause()) pauses or un-pauses the timer, so this is a quick vimrc fix:
autocmd! User GoyoEnter call s:on_goyo_enter()
autocmd! User GoyoLeave call s:on_goyo_exit()
function s:on_goyo_enter()
if exists('g:airline#extensions#clock#timer')
call timer_pause(g:airline#extensions#clock#timer, 1)
endif
endfunction
function s:on_goyo_exit()
if exists('g:airline#extensions#clock#timer')
call timer_pause(g:airline#extensions#clock#timer, 0)
endif
endfunction
I'll submit a patch to enricobacis/vim-airline-clock as I think the timer should be paused whenever Airline is toggled.
When using goyo and airline with enricobacis/vim-airline-clock, the originally hidden airline appears after the first update of the clock.
Part of my .vimrc that matters:
Simplest solution (thus far) is to disable the airline clock or to disable/reenable the plugin at gogo_enter/gogo_leave. As the package is supporting airline hiding, this should be part of the default disabled packages as well. Using vim 8.1 with the latest versions of all packages mentioned.