goyo.vim icon indicating copy to clipboard operation
goyo.vim copied to clipboard

Quitting vim w/goyo is not working with vimwiki

Open rsyi opened this issue 5 years ago • 1 comments

I've added this snippet to my .vimrc file to permit :q to quit both goyo and vim, but I noticed it doesn't work when I am using vimwiki and have multiple entries in my buffer, even if I remove the single buffer condition.

The pared-down snippet in my .vimrc is:

function! s:goyo_enter()
  let b:quitting = 0
  autocmd QuitPre <buffer> let b:quitting = 1
endfunction

function! s:goyo_leave()
  if b:quitting
      qa
  endif
endfunction

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

Naturally, removing if b:quitting allows the me to leave vim w/:q, suggesting b:quitting not being set correctly by autocmd QuitPre, but I'm not sure where to go from here. Any thoughts on how to fix this?

I'm using vim 8.1.

rsyi avatar Dec 12 '19 06:12 rsyi

Please check this from there Wiki, there are more commands to be added in your function. I have copied this exact and it is working for me even with VimWiki.

samyakbardiya avatar Jul 14 '20 04:07 samyakbardiya