While working a Markdown plugin, we've wanted to change the filetype from mkd
to markdown
to increase compatibility with other plugins.
To avoid breaking users .vimrc
that had autocommands like:
autocmd FileType mkd echo 'a'
we've tried using:
set filetype=mkd.markdown
from ftdetect/markdown.vim
, since help 'ft'
says both types would be tried.
Now the syntax works fine, but the autocmd does not run. The only way to make it run is to use:
autocmd FileType mkd.markdown echo 'a'
which is obviously bad.
Is there a way to avoid breaking user autocommands in this case?
set ft=mkd
andset ft=mkd.markdown
?set ft
line? The file: github.com/plasticboy/vim-markdown/blob/master/ftdetect/…set ft=mkd || set ft=mkd.markdown
in ftdetect seems to work, but when I open a markdown file it echos an empty line and requires me to press enter, not sure why. But that is a bit ugly, specially I'd also have to add aset ft=markdown
to make it work for users who update to the new filetype.