Domanda

I'm using Pathogen, and am using git clones of xmledit and sparkup as bundles. These two plugins are automatically enabled for HTML, but I want to enable them for other HTML-like filetypes, such as Handlebars.

How can I automatically load ftplugins for HTML when I load a Handlebars buffer? I'm specifically looking for a solution that doesn't involve making any changes to the xmledit or sparkup git repos.

È stato utile?

Soluzione

When Handlebars is exactly like HTML, just teaching the filetype detection to treat it as HTML is the easiest way; you'll automatically get the syntax, indent, and other settings.

In case it is only somewhat related, and you just want to "import" certain, but not all settings from the HTML filetype, define your own ~/.vim/ftplugin/handlebars_sparkup.vim (assuming you already have a filetype detection that yields &ft=handlebars for your files). In that file, :runtime the corresponding HTML filetype scripts that you need, e.g.

:runtime! ftplugin/html_sparkup.vim
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top