Closed hahuang65 closed 4 years ago
When using with vimwiki, and I am in :Goyo mode, <CR> has issues.
:Goyo
<CR>
In vimwiki, <CR> is mapped to :VimwikiFollowLink (https://github.com/vimwiki/vimwiki/blob/master/doc/vimwiki.txt#L274)
:VimwikiFollowLink
It will take the current word, and create a link, or follow it. The creation of the link works fine as depicted by these two screenshots:
But then, attempting to follow the link results in exiting out of Goyo:
Once out of Goyo, I can finally follow the link (but leaves me out of Goyo):
Here is my setup for activating Goyo:
nnoremap <localleader>g :Goyo<CR> function! s:goyo_enter() let b:quitting = 0 let b:quitting_bang = 0 autocmd QuitPre <buffer> let b:quitting = 1 cabbrev <buffer> q! let b:quitting_bang = 1 <bar> q! endfunction function! s:goyo_leave() " Quit Vim if this is the only remaining buffer if b:quitting && len(filter(range(1, bufnr('$')), 'buflisted(v:val)')) == 1 if b:quitting_bang qa! else qa endif endif endfunction autocmd! User GoyoEnter call <SID>goyo_enter() autocmd! User GoyoLeave call <SID>goyo_leave() augroup vimwiki_goyo autocmd! FileType vimwiki :Goyo augroup end
I resolved it by simply using
autocmd! BufRead,BufNewFile *.md :Goyo 75%x75%
When using with vimwiki, and I am in
:Goyo
mode,<CR>
has issues.In vimwiki,
<CR>
is mapped to:VimwikiFollowLink
(https://github.com/vimwiki/vimwiki/blob/master/doc/vimwiki.txt#L274)It will take the current word, and create a link, or follow it. The creation of the link works fine as depicted by these two screenshots:
![Screen Shot 2020-04-13 at 4 15 14 PM](https://user-images.githubusercontent.com/280972/79169715-01682d80-7da2-11ea-9558-94d169116c20.png)
But then, attempting to follow the link results in exiting out of Goyo:![Screen Shot 2020-04-13 at 4 16 02 PM](https://user-images.githubusercontent.com/280972/79169750-1644c100-7da2-11ea-8594-b859a10523ca.png)
Once out of Goyo, I can finally follow the link (but leaves me out of Goyo):![Screen Shot 2020-04-13 at 4 16 33 PM](https://user-images.githubusercontent.com/280972/79169775-28befa80-7da2-11ea-9ad6-0277f2a34644.png)
Here is my setup for activating Goyo: