Vim as XML EditorTable of ContentsWelcome :)Chapter 1. IntroChapter 2. AboutPrerequisitesLearning VimConventionsNotationTerminologyInstallation on LinuxVimToolsSourcesColophonDBX to XHTMLDBX to XSLFO to PDFChapter 3. SetupGeneralLinuxWindowsvimrcmatchit.vimxmleditCatalogsxmllintOn LinuxOn WindowsRXPOn LinuxOn WindowsChapter 4. More SetupRubyOn LinuxOn WindowsCross-OS Tool CallsJingXMLStarletOn LinuxOn WindowsTry it outTidyOn LinuxOn WindowsSettingsChapter 5. TasksCreating TagsCreating DocumentsMarking up TextWith xmleditWith RecordingMarking up TablesRecordingSubstitutionGenerating XMLSearch and ReplaceXPath-based EditingRowsChapter 6. More TasksQuestionsValidationPretty-printingExampleCleaning upHTMLChapter 7. edWhy ed?BasicsLet's GoPretty printingMoreChapter 8. ThanksAcknowledgementsChapter 9. LicenseFreedoc LicenseAboutMainGlossaryIndexAppendix A. URLsDraftDraftDraftDraftVim as XML Editor Tobias Reifemail: tobiasreif pinkjuice comVim as XML EditorTobias ReifRevision HistoryRevision 0.10.72005-05-19last changeRevision 0.12002-12-15first draftDraftDraftDraftVim as XML EditorDraftDraftVim as XML EditorDraftTable of ContentsWelcome :) 1. Intro 2. About Prerequisites Learning Vim Conventions Installation on Linux Sources Colophon 3. Setup General vimrc matchit.vim xmledit Catalogs xmllint RXP 4. More Setup Ruby Jing XMLStarlet Tidy 5. Tasks Creating Tags Creating Documents Marking up Text Marking up Tables Generating XML Search and Replace XPath-based Editing 6. More Tasks Questions Validation Pretty-printing Cleaning up 7. ed Why ed? Basics Let's Go More 8. Thanks Acknowledgements 9. License Freedoc License Glossary Index A. URLs DraftDraftDraftVim as XML EditorDraftDraftVim as XML EditorDraftList of Examples3.1. ~/.bashrc 3.2. vimrc 3.3. ~/data/conf/xml/catalog 3.4. install_libxml 3.5. ~/bin/xmlval 3.6. xmllint.bat 3.7. xmllint.bat (Windows 95/98/ME) 3.8. rxp.bat 3.9. rxp_raw.bat (Win9*) 3.10. rxp.bat (Win9*) 3.11. rxpval.bat 4.1. cross_os_calls.rb 4.2. jing 4.3. jing.bat 4.4. install_xmlstar 4.5. tidy.bat 6.1. xmllintval.bat DraftDraftDraftWelcome :)DraftDraftWelcome :)DraftWelcome :) If Vim is your main text editor, and if you do a lot of XML editing, then this howto might help you to make that even more fun. The latest print version is at http://www.pinkjuice.com/howto/vimxml/print/. The online version is at http://www.pinkjuice.com/howto/vimxml/.I appreciate any feedback, error reports are especially welcome. My email address is tobiasreif pinkjuice com . You can rate this howto at www.vim.org [url 1].DraftDraftDraftIntroDraftDraftIntroDraftChapter 1. Intro Vim is a great editor with many features, and it's extensible. So by learning a subset of the features, customizing it by setting preferences, and by extending it with plugins and scripts, each user builds his own editor. Existing extensions are available from http://www.vim.org/ (alternative URL: http://vim.sourceforge.net/). Vim also is very fast and is available for many platforms. I use Vim for all my editing (XHTML, Ruby, XSLT, CSS, DBX, SVG, etc.) which means that I don't have to learn a new editor for each language. On my Vim page [url 2] there's some general info. Vim is a text editor, and even when extended with some XML specific functionality, it is not a full-blown XML editor: For example, there's no tags- or WYSIWYG view, and no real structure/tree view. I don't really miss entry help (context-sensitive suggestions for completion), but this and other schema-driven (DTD, WXS, RNG, etc) functionality found in editors like nXML [url 3] could be implemented using Vim's Python interface [url 4] plus libxml's Python bindings [url 5], for example. But since XML editing most often also involves a lot of general text editing tasks, and Vim offers such a vast range of functionality for those, Vim can be set up to be a surprisingly useful XML editor, especially for people who like reading the documentation and schemas of the specific XML language. This is not really a howto. It's more a collection of tips, examples, and ideas than a complete instructional guide intended to be read from cover to back. I will simply show my current setup; there are many different variations possible. You could for example browse the sections, then pick the things which seem useful to you. There's a Vim XML Wiki page [url 6] on the SVG Wiki, and on vim.org you can search for XML scripts [url 7] and XML tips [url 8]. Please add your tips, scripts, and links. Vim is Free Software and Charityware. If you like and use it, please consider making a donation [url 9] to ICCF Holland [url 10]. Also see :help uganda [url 11]. Most of the things described should work on Linux and other Unix-like operating systems such as BSD, and might also work on Windows. If you're using an emulation layer things might complicate. For example if you're using Cygwin you'll probably have to figure out some mix of the Linux and Windows setup instructions. NoteSome of the Windows-specific stuff might be outdated since I don't have Windows anymore.Many of the tools and techniques described in this howto can also be used without Vim, for example from the shell, from scripts, and from other editors.There are some screenshots at http://www.pinkjuice.com/howto/vimxml/pics/screens/. DraftDraftDraftAboutDraftDraftAboutDraftChapter 2. About... this howto.PrerequisitesPrerequisites