junegunn / goyo.vim

:tulip: Distraction-free writing in Vim
MIT License
4.49k stars 115 forks source link

Options are not mantained when changing buffers with fzf #273

Closed jfab20 closed 1 year ago

jfab20 commented 1 year ago

I have the following config

function! s:goyo_enter()
  set rnu 
  set nu
endfunction

function! s:goyo_leave()
  set rnu 
  set nu
endfunction

autocmd! User GoyoEnter nested call <SID>goyo_enter()
autocmd! User GoyoLeave nested call <SID>goyo_leave()

noremap <leader>o :call fzf#run({'source': 'find ~', 'sink': 'e' , 'window': '30vnew'})<CR><CR>

When I enter Goyo, relative numbers are enabled, but when I do <leader>o and go to a different file with fzf, relative numbers are not enabled.

jfab20 commented 1 year ago

Reading previous issues I think there is some workaround to make Goyo remember settings when changing buffers but the simplest solution is to just to put let g:goyo_linenr=1 in vimrc.