0

How, using Vundle, can I load a ftplugin for a filtype it wasn't written for?

In my old .vimrc (before I started using Vundle), I would do something like this:

au FileType xquery ru fplugin/xhtml.vim

But that doesn't seem to be doing the trick.

...any thoughts? Thanks!

Mr Mikkél
  • 2,577
  • 4
  • 34
  • 52

2 Answers2

0

(Not a Vundle user, and I think it should not affect your command.)

Instead of the :autocmd, create a file ftplugin/xquery.vim (either under ~/.vim/ or as a bundle), with the following contents:

runtime! ftplugin/xhtml.vim
runtime! ftplugin/xhtml_*.vim ftplugin/xhtml/*.vim

(This assumes you have :filetype plugin on.)

Ingo Karkat
  • 167,457
  • 16
  • 250
  • 324
  • 1
    The one thing I want to get away from is touching anything in the .vim directory if I can help it. I want to have a "vanilla installation", if you will as far as the plugins go, and maintain any craziness in the .vimrc – Mr Mikkél Nov 13 '13 at 16:40
  • I see it the other way around: I try to move as much as possible to `.vim`, so that my `.vimrc` only contains essential global settings. I've seen veeeery long `.vimrc`s that are a horror to maintain. – Ingo Karkat Nov 14 '13 at 07:27
  • Well, the reason I want to place all the burden on the vimrc is because I'm using spf13 - an automated script that builds out this complete package (using vundle) of plugins and mappings. I want the installation to be clean so that I can run the spf13 script on another machine and simply drop in my .vimrc once I'm done, instead of having to reconfigure the plugins each time... I'm really good, btw, at keeping a fairly clean and maintainable .vimrc – Mr Mikkél Nov 14 '13 at 17:26
0

OK, so I'm just coming back to this, and it turns out that what I had up there actually does work. Except that the line that I'm actually using in Vim uses a lower case "t" in "Filetype". Not sure if that was the issue, but it works perfectly now:

au Filetype xquery ru ftplugin/xhtml.vim
Mr Mikkél
  • 2,577
  • 4
  • 34
  • 52