diff --git a/ftplugin/markdown.vim b/ftplugin/markdown.vim index 026e605..164761e 100644 --- a/ftplugin/markdown.vim +++ b/ftplugin/markdown.vim @@ -1,5 +1,5 @@ augroup livedown - if g:livedown_autorun + if get(g:, 'livedown_autorun', 0) au! BufWinEnter LivedownPreview endif diff --git a/ftplugin/mkd.vim b/ftplugin/mkd.vim index 026e605..164761e 100644 --- a/ftplugin/mkd.vim +++ b/ftplugin/mkd.vim @@ -1,5 +1,5 @@ augroup livedown - if g:livedown_autorun + if get(g:, 'livedown_autorun', 0) au! BufWinEnter LivedownPreview endif diff --git a/plugin/livedown.vim b/plugin/livedown.vim index 64efaa2..0a46319 100644 --- a/plugin/livedown.vim +++ b/plugin/livedown.vim @@ -2,10 +2,6 @@ command! LivedownPreview :call s:LivedownPreview() command! LivedownKill :call s:LivedownKill() command! LivedownToggle :call s:LivedownToggle() -if !exists('g:livedown_autorun') - let g:livedown_autorun = 0 -endif - if !exists('g:livedown_open') let g:livedown_open = 1 endif