markdown-preview.nvim
markdown-preview.nvim copied to clipboard
conflicts with Goyo plugin
I frequently use the goyo.vim plugin for writing markdown. I currently have these relevant settings in my vimrc:
let g:mkdp_auto_start = 1
let g:mkdp_refresh_slow = 0
When I open a markdown file in Vim it automatically opens in the browser as I would expect. When I then enter Goyo layout using the :Goyo
command my browser (Brave) opens the file in several more tabs (7 to be exact). I can close the tabs and things work like normal but then when I exit Goyo and return to the default Vim view it opens another tab.
I haven't figured out if this is a problem with markdown-preview or with Goyo but open to suggestions of how to fix.
I see, the g:mkdp_auto_start
and g:mkdp_auto_start
conflicts with Goyo
Sort of a workaround but I'm using a function now to start MarkdownPreview after entering Goyo and that seems to be working well.
let g:mkdp_auto_start = 0
let g:mkdp_refresh_slow = 0
let g:mkdp_browser = 'Brave Browser'
function! s:goyo_enter()
# set <prefs for Goyo>
execute "MarkdownPreview"
endfunction
function! s:goyo_leave()
# set <prefs for Goyo>
execute "MarkdownPreviewStop"
endfunction
autocmd! User GoyoEnter nested call <SID>goyo_enter()
autocmd! User GoyoLeave nested call <SID>goyo_leave()
Goyo
seems to create multiple invisible vim panes to achieve the padding effect. I am not sure if that is related.