Wikia

Vim Tips Wiki

Changes: Script:1397

Edit

Back to page

(different versions)
(Change <tt> to <code>, perhaps also minor tweak.)
 
Line 12: Line 12:
 
?--[[User:Gqqnb|Gqqnb]] 05:50, December 26, 2011 (UTC)
 
?--[[User:Gqqnb|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).
 
: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 <tt>~/.vim/ftplugin/xml.vim</tt> (Unix) or <tt>$HOME/vimfiles/ftplugin/xml.vim</tt> (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).
+
: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 <code>~/.vim/ftplugin/xml.vim</code> (Unix) or <code>$HOME/vimfiles/ftplugin/xml.vim</code> (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 {{tt|filetype indent on}} you also need (I think) to create a file in directory <tt>~/.vim/indent</tt> (Unix) or <tt>$HOME/vimfiles/indent</tt> (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 <tt>echo</tt> command shown in the docs, namely the single line: {{tt|1=let b:did_indent = 1}} [[User:JohnBeckett|JohnBeckett]] 03:45, December 27, 2011 (UTC)
+
:If you use <code>filetype indent on</code> you also need (I think) to create a file in directory <code>~/.vim/indent</code> (Unix) or <code>$HOME/vimfiles/indent</code> (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 <code>echo</code> command shown in the docs, namely the single line: <code>let b:did_indent = 1</code> [[User:JohnBeckett|JohnBeckett]] 03:45, December 27, 2011 (UTC)
   
::For each file(xml.vim, docbk.vim, xsl.vim, html.vim, xhtml.vim) in <tt>$HOME/vimfiles/indent</tt>, change their content to {{tt|1=let b:did_indent = 1}}. Am I right?--[[User:Gqqnb|Gqqnb]]
+
::For each file(xml.vim, docbk.vim, xsl.vim, html.vim, xhtml.vim) in <code>$HOME/vimfiles/indent</code>, change their content to <code>let b:did_indent = 1</code>. Am I right?--[[User:Gqqnb|Gqqnb]]
:::These files would not exist (by default); indeed, the <tt>indent</tt> directory does not exist after a standard install, and it would have to be manually created. But yes, each file should be created and should have the same content, namely that single line (which would disable the standard ftplugin scripts distributed with Vim from affecting indentation). Note that I'm guessing as I have never tried to use script 1397. [[User:JohnBeckett|JohnBeckett]] 10:29, December 27, 2011 (UTC)
+
:::These files would not exist (by default); indeed, the <code>indent</code> directory does not exist after a standard install, and it would have to be manually created. But yes, each file should be created and should have the same content, namely that single line (which would disable the standard ftplugin scripts distributed with Vim from affecting indentation). Note that I'm guessing as I have never tried to use script 1397. [[User:JohnBeckett|JohnBeckett]] 10:29, December 27, 2011 (UTC)
   
 
== github version is different from vim.org/scripts version! ==
 
== github version is different from vim.org/scripts version! ==
The version info in both is equally out of date (revision 1.37 date 2009-11-12), but https://raw.github.com/othree/xml.vim/master/ftplugin/xml.vim is bigger than
+
The version info in both is equally out of date (revision 1.37 date 2009-11-12), but https://raw.github.com/othree/xml.vim/master/ftplugin/xml.vim is bigger than
 
http://www.vim.org/scripts/download_script.php?src_id=16076
 
http://www.vim.org/scripts/download_script.php?src_id=16076
 
-- [[User:Skierpage|Skierpage]] 05:31, February 10, 2012 (UTC)
 
-- [[User:Skierpage|Skierpage]] 05:31, February 10, 2012 (UTC)
Line 28: Line 28:
 
This makes no sense. I think you mean "I started from xmledit.vim (htt...) and made improvements"
 
This makes no sense. I think you mean "I started from xmledit.vim (htt...) and made improvements"
   
''The documentation will be created once the script is loaded e.g edit a xml file.<br />Read the help documentation by typing from within vim :help xml-plugin''
+
''The documentation will be created once the script is loaded e.g edit a xml file.<br />Read the help documentation by typing from within vim :help xml-plugin''
   
 
Confusing passive voice, better:
 
Confusing passive voice, better:
: The script creates its help documentation when it is first loaded, for example the first time you edit an xml file.<br />You can then read the help documentation in vim by entering <tt>:help xml-plugin</tt>
+
: The script creates its help documentation when it is first loaded, for example the first time you edit an xml file.<br />You can then read the help documentation in vim by entering <code>:help xml-plugin</code>
   
 
=== xml-plugin.txt improvements===
 
=== xml-plugin.txt improvements===
Line 40: Line 40:
 
'' '%' will jump between '<' and '>' ''
 
'' '%' will jump between '<' and '>' ''
   
This didn't work for me and made me think the script was broken. e.g.
+
This didn't work for me and made me think the script was broken. e.g.
: Pressing '\' then '%' will jump between '<' and '>' ('\' is the default character for your <nowiki><LocalLeader></nowiki> character)
+
: Pressing '\' then '%' will jump between '<' and '>' ('\' is the default character for your <nowiki><LocalLeader></nowiki> character)
   
 
''To activte the script place 'filetype plugin on' ''
 
''To activte the script place 'filetype plugin on' ''
Line 48: Line 48:
 
: To activate the script add 'filetype plugin on'
 
: To activate the script add 'filetype plugin on'
   
''If the file edited is of type "html" and "xml_use_html" is defined then
+
''If the file edited is of type "html" and "xml_use_html" is defined then
 
the following tags ''
 
the following tags ''
   
Line 60: Line 60:
 
'' [[ Goto to the next open tag''
 
'' [[ Goto to the next open tag''
   
That should be <tt>]]</tt>, and use proper English "Go to" in all these lines.
+
That should be <code>]]</code>, and use proper English "Go to" in all these lines.
 
   
 
Once I figured out <nowiki><LocalLeader></nowiki>, this is a great plug-in!
 
Once I figured out <nowiki><LocalLeader></nowiki>, this is a great plug-in!

Latest revision as of 09:40, July 14, 2012

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 compatibleEdit

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)

InstallationEdit

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 file(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
These files would not exist (by default); indeed, the indent directory does not exist after a standard install, and it would have to be manually created. But yes, each file should be created and should have the same content, namely that single line (which would disable the standard ftplugin scripts distributed with Vim from affecting indentation). Note that I'm guessing as I have never tried to use script 1397. JohnBeckett 10:29, December 27, 2011 (UTC)

github version is different from vim.org/scripts version! Edit

The version info in both is equally out of date (revision 1.37 date 2009-11-12), but https://raw.github.com/othree/xml.vim/master/ftplugin/xml.vim is bigger than http://www.vim.org/scripts/download_script.php?src_id=16076 -- Skierpage 05:31, February 10, 2012 (UTC)

Language improvements Edit

A plugin for editing xml. I used xml.vim (http://www.vim.org/scripts/script.php?script_id=301)

This makes no sense. I think you mean "I started from xmledit.vim (htt...) and made improvements"

The documentation will be created once the script is loaded e.g edit a xml file.
Read the help documentation by typing from within vim :help xml-plugin

Confusing passive voice, better:

The script creates its help documentation when it is first loaded, for example the first time you edit an xml file.
You can then read the help documentation in vim by entering :help xml-plugin

xml-plugin.txt improvementsEdit

formated documents

"formatted documents"

'%' will jump between '<' and '>'

This didn't work for me and made me think the script was broken. e.g.

Pressing '\' then '%' will jump between '<' and '>' ('\' is the default character for your <LocalLeader> character)

To activte the script place 'filetype plugin on'

Typo and better

To activate the script add 'filetype plugin on'

If the file edited is of type "html" and "xml_use_html" is defined then the following tags

Avoid passive voice, better

If you edit an HTML file (filetype=html in vim) and "xml_use_html" is defined (see xml_plugin_settings), then the following tags

Mapings and their functions

Typo, "Mappings"

[[ Goto to the next open tag

That should be ]], and use proper English "Go to" in all these lines.

Once I figured out <LocalLeader>, this is a great plug-in! -- Skierpage 04:36, February 10, 2012 (UTC)

CommentsEdit

Around Wikia's network

Random Wiki