sponsor Vim development Vim logo Vim Book Ad

HTML.zip : HTML/XHTML editing macros and menus

 script karma  Rating 372/140, Downloaded by 13385    Comments, bugs, improvements  Vim wiki

created by
Christian J. Robinson
 
script type
utility
 
description
This is a set of HTML/XHTML mappings 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.

The macros automatically insert a tag and position the cursor at the logical insert point.  For example, in insert the mapping ";ah" inserts <A HREF=""></A> and leaves the cursor between the double quotes.  If you were to visually highlight some text then type ";ah" it would wrap the tag around the text.  For example:
        some text
Becomes:
        <A HREF="">some text</A>
With the cursor positioned between the double quotes in insert mode. Or if you used ";aH" instead:
        <A HREF="some text"></A>
With the cursor positioned between the > and the < in insert mode.

There are many other features, such as a configurable template inserted with the ";html" normal mode macro, browser remote control mappings, etc.

See http://christianrobinson.name/vim/HTML/faq.shtml for frequently asked questions.

See http://christianrobinson.name/vim/HTML/HTML.html to preview the help file.
 
install details
Put ":filetype plugin on" in your vimrc, then extract HTML.zip in your runtime directory (~/.vim for Unix; see ":help 'runtimepath'"). Then run ":helptags <directory>/doc" within vim.

See http://christianrobinson.name/vim/HTML/ for more information, other archive formats, newer versions, and extra files.
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
HTML.zip 0.40.1 2012-11-26 7.2 Christian J. Robinson - More fraction entities added
- globpath() → findfile() for compatibility with Vundle (Leif Arne Storset)
HTML.zip 0.39.4 2011-10-01 7.2 Christian J. Robinson - Added:
  + <param> (;pm) mapping
  + • (&*) mapping
- Fixed:
  + Slight problem with the <noscript> (;ns) mapping
  + HTMLnextInsertPoint() (tab mapping) might not properly jump to the end of a closing comment dilimeter. (Samuel Ferencik)
HTML.zip 0.39.1 2011-08-04 7.2 Christian J. Robinson - Character entity conversion mappings can now encode to &#x..; hexadecimal strings, and decode them as well (Samuel Ferencik)
- Roman numeral character entity mappings added (Samuel Ferencik)
HTML.zip 0.38.1 2011-06-02 7.2 Christian J. Robinson - Euro entity mapping and menu (Samuel Ferencik)
- HTMLnextInsertPoint() sometimes didn't restore options (Samuel Ferencik)
- Entire scriptencoding has been changed to utf8 instead of partially latin1
HTML.zip 0.37.1 2011-04-21 7.2 Christian J. Robinson - Determining the Firefox remote command wasn't working properly (Fr. Robert Bower)
- Fr. Robert Bower added support for Google Chrome on Unix/Linux

(This script _might_ run okay on Vim 7.0/7.1, but it has not been tested -- 7.3 is preferred.)
HTML.zip 0.36.4 2010-08-07 7.0 Christian J. Robinson - More character entity mappings
- Minor changes
HTML.zip 0.36.3 2010-07-01 7.0 Christian J. Robinson - Various minor fixes
HTML.zip 0.36.1 2009-10-28 7.0 Christian J. Robinson - b:no_html_maps can be set like g:no_html_maps
- Israel Chauca Fuentes provided MacOS browser control code
- minor fixes and changes
HTML.zip 0.35.1 2008-06-15 7.0 Christian J. Robinson - Try to safely escape shell commands
HTML.zip 0.35 2008-06-10 7.0 Christian J. Robinson - Added:
  + The colors in the color menu can be displayed in a split window under the GUI, and colors can be selected from the display (;# mapping and :ColorSelect command)
  + g:no_html_map_override can be set to prevent the plugin from overriding already existing mappings, and now warning messages are printed when overriding takes place
  + g:no_html_maps can be set to a regular expression to tell the plugin not to define matching mappings
  + g:html_map_entity_leader can be used to define the character entity mapping leader--works like g:html_map_leader
  + MangleImageTag.vim (used by the ;mi mapping) no longer moves the cursor
  + Miscellaneous minor additions
- Miscellaneous fixes
- Significant refactoring to make maintaining the plugin easier
HTML.zip 0.34 2008-05-07 7.0 Christian J. Robinson - Removed code that was supporting Vim 6, thus:
  + MangleImageTag() used by ;mi mapping should now always compute correct size
  + Various code was simplified
HTML.zip 0.33.1 2008-04-29 6.0 Christian J. Robinson - Character entities for arrows and the Greek alphabet added
- This is the last version that will support Vim 6
HTML.zip 0.32.2 2008-04-13 6.0 Christian J. Robinson - Fixed:
  + Some of the "boolean" configuration variables weren't being tested right (Keith Lancaster)
  + Could get an error when (re-)initializing the menus
- Changed:
  + The ;& and ;% normal mode mappings now behave as operator (motion) mappings--use ;&l or ;%l to emulate the old behavior
- Added:
  + :HTMLmappings reload/html/xhtml can force reloading of the entire script, or switch the mappings into html/xhtml mode
- misc. minor fixes
HTML.zip 0.30 2008-03-07 6.0 Christian J. Robinson - Fixed:
  + Exclude leading indent from the start tag for visual mappings when in visual-line mode
- Added:
  + ;tH (<THEAD>), ;tf (<TFOOT>), and ;tb (<TBODY>) mappings added
HTML.zip 0.29.2 2007-09-10 6.0 Christian J. Robinson - Fixed:
  + Tab mapping wasn't positioning the cursor right when there were multiple spaces between a opening and closing tag
- Added:
  + Make the <html> tag include an xmlns attribute for XHTML
HTML.zip 0.29 2007-08-02 6.0 Christian J. Robinson - Added:
  + g:html_tag_case_autodetect configuration variable
- Fixed:
  + The HTMLnextInsertPoint() function was causing a press enter prompt
  + 'formatoptions' could make visual mappings behave wrong
- Other minor additions and fixes
HTML.zip 0.28.2 2007-06-29 6.0 Christian J. Robinson - Fixed:
  + Defining the menus failed entirely if g:no_html_toolbar was set
- Changes:
  + Add "Select Tag" and "Select Inner Tag" to the PopUp menu
  + Minor tweaks
HTML.zip 0.28 2007-06-24 6.0 Christian J. Robinson - Fixed:
  + Visual mode mappings weren't operating properly when 'selection' was set to "exclusive"
- Added:
  + ;db -- default browser mapping for Windows
HTML.zip 0.27.6 2007-06-12 6.0 Christian J. Robinson - Fixed:
  + Menus weren't getting disabled/enabled properly
- Changed:
  + <DT> and <DD> tags now have closing tags and visual mappings
  + ;;-style mapping for whatever g:html_map_leader is set to
  + Internal code changes
HTML.zip 0.27.4 2007-06-06 6.0 Christian J. Robinson - Added:
  + Smart handling of <EM></EM> tags
  + ;% mapping added -- like ;& but convert to %XX hex strings for URIs
- Changed:
  + Moved ;ns / ;nns mappings to ;ne / ;nne, and moved ;nj mappings to ;ns
HTML.zip 0.27.1 2007-05-31 6.0 Christian J. Robinson - Added:
  + g:force_html_menu can be set to force the HTML menus to be defined in the console
  + g:no_html_menu can be set to stop the menu and toolbar items from being defined
  + w3m browser preview under *nix
- Minor changes and fixes
HTML.zip 0.26.8 2007-05-18 6.0 Christian J. Robinson - Fixed:
  + MangleImageTag() used by ;mi mapping was missing some quotes and computing the wrong sizes when 'encoding' was UTF8 or similar
  + Tab on the end of a line in insert mode moved the cursor a character left
  + Temporarily clear the 'comments' option for the ;js mapping so extraneous // comments weren't inserted
- Various minor changes
HTML.zip 0.26.5 2007-04-23 6.0 Christian J. Robinson - Fixed:
  + When 'filetype' was set in a modeline ":HTMLmappings disable" didn't work
  + Mappings defined with HTMLmap()/HTMLmapo() outside the script weren't redefined when :HTMLmappings disable then enable was run
- Added:
  + ;aH, ;aT, ;aN, etc. now work in insert mode -- they get data from the clipboard
  + ;nj mapping for <NOSCRIPT><CR></NOSCRIPT> added
  + visual and normal mode mappings for ;ob
- Various minor changes and fixes
HTML.zip 0.26 2007-04-10 6.0 Christian J. Robinson - Added:
  + ":HTMLmappings disable/enable" command
  + %vimversion% template token
- Fixed:
  + Some recently added mappings weren't in the menu
  + Inserting the HTML template could trigger the "Press ENTER" prompt
HTML.zip 0.25.5 2007-03-30 6.0 Christian J. Robinson - New mappings:
  + ;sj mapping -- like ;js but for sourced JavaScript
  + ;^ mapping to decode &#...; encoded strings
  + ;& in insert mode inserts a literal &
- Minor changes
HTML.zip 0.25.1 2007-03-11 6.0 Christian J. Robinson - Allow b:html_template to be set in addition to g:html_template
- HTMLnextInsertPoint() used by the <tab> mapping now handles comments, and no longer requires an argument
- ;s4 mapping added -- Same as ;4 only strict rather than transitional
- %time%, %time12%, and %time24% template tokens added, and %date% token is now customizable
- b:do_xhtml_mappings was being ignored
HTML.zip 0.24 2007-02-22 6.0 Christian J. Robinson - In rare cases the script tried to re-enable the ToolBar buttons when they didn't exist
- g:no_html_tab_mapping can be defined to 'move' the <tab> mappings to ;<tab>
- misc. fixes and additions
HTML.zip 0.23.2 2006-12-12 6.0 Christian J. Robinson - Bug when testing for g:html_charset
- Fix a couple of the forms mappings
- Documentation updates and fixes
HTML.zip 0.23.1 2006-12-11 6.0 Christian J. Robinson - Dynamic charset support for the template and the ;ct mapping, based on the 'fileencoding', and 'encoding' options (but the conversion table is limited, see ":help html-author-notes")
- <option> tag wasn't properly closed
HTML.zip 0.22.2 2006-12-04 6.0 Christian J. Robinson - browser_launcher.vim: Bug in detecting the remote command
- ;me mapping wasn't properly positioning the cursor
- Minor documentation fixes
HTML.zip 0.22.1 2006-11-14 6.0 Christian J. Robinson - Make the leader of the ;-mappings configurable with g:html_map_leader
- Fix error when g:no_html_toolbar is set
HTML.zip 0.21.2 2006-10-13 6.0 Christian J. Robinson - ;im mapping wasn't properly positioning the cursor
- Minor improvement to the HTMLnextInsertPoint function used by the tab mapping
HTML.zip 0.21 2006-10-04 6.0 Christian J. Robinson - Basic support for XHTML added--see ":help g:do_xhtml_mappings"
- Misc. minor fixes
HTML.zip 0.20.4 2006-05-28 6.0 Christian J. Robinson - ;h1 - ;h6 and mappings no longer create center aligned tags, ;hr no longer has a default width. Use ;H1 - ;H6 / ;Hr if you still want the old default behavior.
- Don't display menu/toolbar entries for browsers that don't exist. (Unix only)
- Allow .-repeating of operator mappings to work properly.
- Code improvements and bug fixes.
HTML.zip 0.19 2006-01-18 6.0 Christian J. Robinson - Smart-handling of certain tags (bold, italic, underline, comments) if syntax highlighting is on.
HTML.zip 0.18 2005-12-26 6.0 Christian J. Robinson - Implemented normal mode mappings that take an operator (motion) for Vim 7.
HTML.zip 0.17.1 2005-10-22 6.0 Christian J. Robinson - Some visual mappings had insert offset problems when 'indentexpr' was set.
- Author email in templates wasn't being encoded (bug since the template became configurable).
HTML.zip 0.16.2 2005-10-08 6.0 Christian J. Robinson Some visual mappings didn't work with the extra code used to prevent a (visual)bell.
HTML.zip 0.16 2005-07-13 6.0 Christian J. Robinson - Fixed some of the forms visual mappings.
- Added code to prevent a (visual)bell with some of the visual mappings when 'showmatch' was enabled.
HTML.zip 0.15.1 2005-05-19 6.0 Christian J. Robinson - MangleImageTag was getting the width and height of gifs reversed.
- Other minor bugs fixed.
HTML.zip 0.15 2004-06-09 6.0 Christian J. Robinson - A bug crept in that prevented the work-around for the GTK2 toolbar pixmap bug from working.
HTML.zip 0.14 2004-04-22 6.0 Christian J. Robinson - ;& mapping to change the visual selection or character under the cursor to its &#...; equivalent.
- ;mi mapping to automatically update the WIDTH/HEIGHT attributes in an IMG tag. (MangleImageTag.vim included. -- Experimental! See ":help ;mi".)
- Misc. bug fixes and tweaks.
HTML.zip 0.13 2004-03-16 6.0 Christian J. Robinson - The template used by ;html is now configurable.
- Colors menu changed from a cascading menu to an alphabetic menu.
- Misc. tweaks.
HTML.zip 0.12 2003-11-04 6.0 Christian J. Robinson - Insert mode mappings weren't buffer-local. (Error when removing Vim5 support.)
HTML.zip 0.11 2003-10-27 6.0 Christian J. Robinson - HTML menu and ToolBar weren't being enabled sometimes when the script was loaded again.
- Abandoned support for vim versions prior to 6.
- More minor changes.
HTML.zip 0.10 2003-09-13 5.7 Christian J. Robinson - Mozilla mappings added.
- HTML encode author email (to prevent spam harvesters).
- Work-around for a bug in the Vim GTK2 toolbar interface that doesn't properly find icons.
- Other minor changes.
ip used for rating: 54.161.200.144

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
SourceForge.net Logo