1

I want to use 'plasticboy/vim-markdown' and 'nelstrom/vim-markdown-folding.' They require filetype=mkd and filetype-markdown, respectively. Is there a typical way to tell a plugin to recognize a certain filetype?

I've tried changing references of mkd to markdown in the former and markdown to mkd in the latter but that hasn't had any effect. As of now, I can only use one of the plugins because they require different filetypes.

chishaku
  • 4,577
  • 3
  • 25
  • 33
  • 1
    You might try setting both filetypes at the same time. http://stackoverflow.com/questions/2601403/multiple-file-types-in-vim. However this may behave poorly. – FDinoff Mar 20 '15 at 22:43
  • Thanks. Working so far. We'll see if any conflicts appear after continued use. – chishaku Mar 20 '15 at 22:45
  • 2
    Doesn't `plasticboy/vim-markdown` support folding out of the box? – svlasov Mar 20 '15 at 22:48

1 Answers1

2

The generic names for the filetype plugins are (:help ftplugin-name):

ftplugin/<filetype>.vim
ftplugin/<filetype>_<name>.vim
ftplugin/<filetype>/<name>.vim

Therefore, you need to rename the file names themselves (possibly in addition to the contents in the file, though there shouldn't be that many). Since that makes upgrading more difficult, you can also write linker scripts, e.g. ~/.vim/ftplugin/mkd_fold.vim which just contains the following command:

:runtime! ftplugin/markdown_fold.vim
Ingo Karkat
  • 167,457
  • 16
  • 250
  • 324