chishaku
chishaku

Reputation: 4643

Change recognized filetype of a plugin

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.

Upvotes: 1

Views: 58

Answers (1)

Ingo Karkat
Ingo Karkat

Reputation: 172768

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

Upvotes: 2

Related Questions