markdown-preview.nvim icon indicating copy to clipboard operation
markdown-preview.nvim copied to clipboard

conflicts with Goyo plugin

Open cfsanderson opened this issue 4 years ago • 3 comments

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.

cfsanderson avatar Jun 11 '20 14:06 cfsanderson

I see, the g:mkdp_auto_start and g:mkdp_auto_start conflicts with Goyo

iamcco avatar Jun 19 '20 11:06 iamcco

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()

cfsanderson avatar Jun 19 '20 12:06 cfsanderson

Goyo seems to create multiple invisible vim panes to achieve the padding effect. I am not sure if that is related.

xlucn avatar Jun 22 '20 03:06 xlucn