Vim Tips Wiki
Advertisement

Use this page to discuss script 1397 xml: helps editing xml (and html, sgml, xslt) files

  • Add constructive comments, bug reports, or discuss improvements (see the guideline).
  • Do not document the script here (the author should do that on vim.org).
  • This page may be out of date: check the script's vim.org page above, and its release notes.

No compatible

You have to keep your Vim in no-compatible mode for folding to work. --02:04, September 24, 2011

I refactored the above to insert "no" because I assume no one uses Vim in compatible mode, so the original problem was due to Vim inadvertently being set for compatibility with vi. JohnBeckett 03:45, December 27, 2011 (UTC)

Installation

What do you mean by

Then create a ~/.vim/indent directory and for every link (copy) you made do

echo "let b:did_indent = 1" > ~/.vim/indent/xml.vim

?--Gqqnb 05:50, December 26, 2011 (UTC)

I moved the above to here (it had been posted on the talk page, but this page is intended for discussion on using the script).
The docs at the script page (link at top of page) are poor. My quick thought is that to install the plugin (which I have never seen), you are supposed to copy the supplied xml.vim file to ~/.vim/ftplugin/xml.vim (Unix) or $HOME/vimfiles/ftplugin/xml.vim (Windows). It looks like the same file should be copied (or linked) so it appears in the same directory as docbk.vim, xsl.vim, html.vim, xhtml.vim (if you use those file types).
If you use filetype indent on you also need (I think) to create a file in directory ~/.vim/indent (Unix) or $HOME/vimfiles/indent (Windows) for each file type that will be used (xml.vim, docbk.vim, xsl.vim, html.vim, xhtml.vim). In each case, the file contains only the output from the echo command shown in the docs, namely the single line: let b:did_indent = 1 JohnBeckett 03:45, December 27, 2011 (UTC)

For each files(xml.vim, docbk.vim, xsl.vim, html.vim, xhtml.vim) in $HOME/vimfiles/indent, change their content to let b:did_indent = 1. Am I right?--Gqqnb

Comments

Advertisement