转载http://www.infynity.spodzone.com/vim/HTML/#files
MainProgrammingVim → HTML/XHTML Editing in Vim

HTML/XHTML Editing in Vim

Name

HTML.vim ( Version: 0.35.3 - 123K - Last modified: Jun 20, 2008 - 06:11:11 PM ) – Vim mappings (macros) to make editing HTML/XHTML files quick and easy.

Description

This is a set of HTML/XHTML mappings (macros) and menus for Vim 7 or later. The mappings will be local to the buffer so they won't interfere if you edit other files in the same vim session.

Installation

First you should put "filetype plugin on" in your vimrc.

To install from the zip file

Extract HTML.zip ( 62K - Last modified: Jun 20, 2008 - 06:11:33 PM – Includes HTML.vim, HTML.txt, browser_launcher.vim, MangleImageTag.vim, and the toolbar bitmaps.) in your runtime directory (~/.vim for Unix; see ":help 'runtimepath'"). Then run ":helptags <directory>/doc" within vim.

Automatic installation

WARNING!

Vimball is seriously broken, so it is strongly recommend against using a .vba file to install this plugin. Among the problems are:

  1. The Vimball archiver does not properly preserve file encodings, so the menus for the character entities will not look right (at least when using the GTK or GNOME versions of gVim).
  2. Vimball can not properly store binary data, so if you're on a Windows based system and you want to use the Vimball archive, you still need to manually install the pixmaps ZIP file provided below in your bitmaps directory after installing the Vimball.

Due to these problems, the .vba files here are provided only for historical reasons.

Make sure you have a ~/.vim directory ($HOME/vimfiles under windows).

Download one of these three files: (Includes the same files as HTML.zip above — these archives require a recent version of Vimball.)

  • HTML.vba (198K - Last modified: Jun 20, 2008 - 06:11:34 PM )
  • HTML.vba.gz ( 48K - Last modified: Jun 20, 2008 - 06:11:34 PM )
  • HTML.vba.bz2 ( 44K - Last modified: Jun 20, 2008 - 06:11:34 PM )

Then edit the file and type ":source %". If all went well you're done.

Manual installation

Put "HTML.vim" in your ftplugin/html subdirectory somewhere in your 'runtimepath', then install the files below that you want.

To install for old versions of Vim

Support for Vim 6 and earlier has been abandoned—the last version that supported Vim 5 is version 0.10, and the last version that supported Vim 6 is version 0.33.1.

Other old versions can be found here.

Files

These files—except netscape-remote, the HTML version of the documentation, the ChangeLog, and wikipedia.vim—are included in the HTML.zip & HTML.vba files (see "installation" above).

  • Documentation:
    • HTML.txt ( 42K - Last modified: Jun 18, 2008 - 06:46:25 PM )
      Place this file in the doc subdirectory somewhere in your 'runtimepath' (~/.vim/doc for Unix) and run ":helptags <directory>/doc". Then you'll be able to do ":help HTML.txt".

      (You can view the documentation as HTML here.)

    • ChangeLog (text version)
      Revision notes for all the files listed here.
    • Frequently Asked Questions (text version)
      This covers the most frequent support requests I get.

  • GUI Toolbar Bitmaps:
    vim-html-pixmaps.zip ( 15K - Last modified: Jun 23, 2007 - 04:20:56 AM )
    Extract this in the bitmaps directory somewhere in your 'runtimepath' (~/vim/bitmaps for Unix).

    (You can view a montage of the pixmaps here.)
  • Browser Launcher (for Unix/Linux):
    • browser_launcher.vim (9.5K - Last modified: Jun 15, 2008 - 03:45:45 PM )
      Put browser_launcher.vim in one of the toplevel directories in your 'runtimepath' (such as ~/.vim for Unix).
    • netscape-remote ( 18K )
      This file is optional and is used by browser_launcher.vim when mozilla-xremote-client isn't found in the $PATH—it will fall back to just using netscape/mozilla/firefox instead. To use it just compile it and put the binary somewhere in your $PATH.

      (This version is slightly tweaked by me. The original can be found at http://wp.netscape.com/newsref/std/x-remote.html.)

  • Auto-Update Image Tag Size Attributes:
    MangleImageTag.vim (7.2K - Last modified: May 30, 2008 - 10:53:28 AM ) If this file is placed in one of the toplevel directories in your 'runtimepath' it will cause the ";mi" mapping to be defined.

  • To use these macros for editing MediaWiki/Wikipedia:
    wikipedia.vim (3.3K - Last modified: Jun 18, 2008 - 07:00:52 PM ) You will also need to read Wikipedia's text editor support page; use this file in place of the filetype plugin suggested there.

Support

You can either email me or try my bulletin board.

See also

Some other Vim features and plugins that may be useful for editing (X)HTML:

  • closetag.vim
    This script provides functions and mappings to close open HTML/XML tags.
  • :help ft-html-omni
    How to auto-complete tags, attributes, CSS, JavaScript, etc. in Vim 7.

(Suggestions welcome.)




[About] [Friends] [Pictures] [Programming] [Writing] [Misc]
-  Site Map  -