2

I downloaded xml.vim (xmledit : A filetype plugin to help edit XML, HTML, and SGML documents ). I placed it in my ftplugins folder. I read the documentation and it says: enter :filetype plugin on but this doesn't work, I'm still unable to make the filetype plugin work. Any suggestions?

1
  • 2
    This isn't your problem, but you might want the filetype plugin on in your vimrc. Commented Jan 27, 2010 at 15:33

4 Answers 4

2

As jefromi suggested in his comment, the :filetype plugin on shall be done in the .vimrc. If you enter it manually, the filetype won't be detected on a file already opened, a call to :e would be necessary in that case to take advantage of the automatic detection mechanism. Otherwise, you'd to specific the filetype manually (with a :set ft=xml) as described by idimba.

Sign up to request clarification or add additional context in comments.

Comments

0

Try

:set ft=xml

1 Comment

Before you do this, it wouldn't hurt to try :echo &ft to see if Vim has detected a filetype; if it already says xml, then this isn't going to do you any good.
0

Try putting xml.vim in after/ftplugin/ instead of the default ftplugin folder. This ensures that you override any ftplugin settings that are defined by Vim or the Vim distribution package.

1 Comment

I've the same problem with plugin "xml.vim" and I put it in after/ftplugin/. Still it doesn't work. Typing :scriptnames shows that, it is loaded as last plugin in the list.
0

Your first step should be to test that the file is actually loaded using :scriptnames (as Fred mentioned). If it is loaded but still not working you most likely are getting some settings overwritten by other xml.vim files.

You can try putting it in the /after/ftplugin folder, which didn't work for Fred. If that does not work, check the output of :scriptnames and replace the ftplugin/xml.vim files with yours. That did the trick for me. In my case this involved replacing C:\Program Files (x86)\Vim\vim73\ftplugin\xml.vim with the new xml.vim file. Probably a bit of a hack but it fixed it for me.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.