all is in the title... I did a ftplugin to live preview an html file (php and css also) with a browser, but now, when I open a markdown file, the browser opens too... I saw why: there is this line in the default ftplugin/markdown.vim:
runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
so first question, why does markdown source html ftplugin ? It seems irrevelant for me, but perhaps there are good reasons that I'd be glad to know.
Then, is there a way not to source html ftplugins for markdown files ?
Markdown allows you to use inline HTML. From the spec:
For any markup that is not covered by Markdown’s syntax, you simply use HTML itself. There’s no need to preface it or delimit it to indicate that you’re switching from Markdown to HTML; you just use the tags.
That explains the behavior of the filetype plugin.
It would be best if you could just disable the mentioned live preview; as this is probably triggered by an :autocmd BufWritePost <buffer> ...
, you could probably disable it via something like this in your ~/.vim/after/ftplugin/markdown.vim
:
:autocmd! BufWritePost <buffer>
To completely get rid of the HTML stuff, copy the $VIMRUNTIME/ftplugin/markdown.vim
to your user's ~/.vim/ftplugin/markdown.vim
, and delete / comment out the :runtime
command. The b:did_ftplugin
check will ensure that the original ftplugin, though still being sourced, does nothing.