Lev Lvovsky wrote:
I'm hoping someone can help me with this problem, as it would be really nice to get the XML plugin working.

I've downloaded the plugin described here:

http://www.vim.org/scripts/script.php?script_id=301

I've put the file both in my local ftplugin, and plugin directory, and set ':ftplugin type on', however I'm still unable to do any of the navigation between tags, or autocompletion that the plugin promises. I can load up the help file, however it seems like that's the only part that's actually working. Any bit of help would be appreciated - I'm thinking it's a local config issue (perhaps it's being overridden by the original xml.vim that gets installed with vim?), but I'm not entirely sure.

thanks in advance!
-lev


":ftplugin type on" should get you "E492: Not an editor command: ftplugin type on". It ought to be ":filetype plugin on".

Where exactly did you drop the script? xml plugins are sourced in the following order (on Unix):

$HOME/.vim/ftplugin/xml.vim
$VIM/vimfiles/ftplugin/xml.vim
$VIMRUNTIME/ftplugin/xml.vim
$VIM/vimfiles/after/ftplugin/xml.vim
$HOME/.vim/after/ftplugin/xml.vim

If your script is meant to /replace/ the default script, it should include, near the start,

if exists("b:did_ftplugin") | finish | endif
let b:did_ftplugin = 1

and be located in an "early" directory. If it is meant to /supplement/ the default script without replacing it, it should not include the above lines, and it that case it should be in an "after-directory".

Scripts in .../ftplugin/ are sourced when the filetype corresponding to their name is detected (e.g., ....../ftplugin/xml.vim when a file gets its 'filetype' set to "xml"), those in ....../plugin/ are sourced once, at the end of startup. The former should contain only buffer-local settings (using e.g. ":map <buffer>" or ":setlocal"), the latter are global and should set their settings globally for all files and buffers.


Best regards,
Tony.
--
Best of all is never to have been born.  Second best is to die soon.

Reply via email to