Closed kflu closed 5 years ago
You can use the following to do two things at the same time. It assigns to <localleader>g
the following two actions: 1. hide the scroll bar and 2. trigger the :Goyo
command.
function! Goyo_Focus()
setlocal go-=r
Goyo
endfun
nnoremap <localleader>g :call Goyo_Focus()<CR>
What is left unfinished is to add a counter in the Goyo_Focus
function, so that it records the number of calling of the function and will restore the scrollbar upon exiting the "focused" Goyo mode.
A better solution goes here. Should have read the ReadMe more closely.
" Reconfigure the entry/exit actions of Goyo
function! s:goyo_enter()
setlocal go-=r
endfunction
function! s:goyo_leave()
setlocal go+=r
endfunction
autocmd! User GoyoEnter nested call <SID>goyo_enter()
autocmd! User GoyoLeave nested call <SID>goyo_leave()
" Icing on the cake
nnoremap <localleader>g :Goyo<CR>
A better solution goes here. Should have read the ReadMe more closely.
" Reconfigure the entry/exit actions of Goyo function! s:goyo_enter() setlocal go-=r endfunction function! s:goyo_leave() setlocal go+=r endfunction autocmd! User GoyoEnter nested call <SID>goyo_enter() autocmd! User GoyoLeave nested call <SID>goyo_leave() " Icing on the cake nnoremap <localleader>g :Goyo<CR>
thanks for the tip!
I just feel we could provide a more sensible defaults. Having that config code isn't very user friendly. To provide focus mode I feel Goyou should default to turn off all scroll bars.
I bet the scrollbar is there for a reason. One reason could be that the scroll bar on the right is absolutely necessary for "scrolling with your finger" on some touch-screen devices. Should the default be such that there is no scroll bar, it can take one a couple of hours to debug. (Learned this thing in a hard way on a Thinkpad X230T, a couple of years ago.)
Also, the intrusive white strip on the right (the scroll bar) may not be that big in other GUIs ==>
Scrollbar can be very distracting, especially when gvim is in full-screen mode, and the background is dark:
I had to disable it manually with
:set go-=r