htmlcmd.vim : Rich HTML/XML commands
| script karma
Downloaded by 4228
Comments, bugs, improvements
script versions (upload new version)
|This script handles a number of mundane tasks in HTML / XML. It allows you to create a default HTML header (Alt+0), to define headings <h1> .. <h6> (Alt+1.. Alt+6), to toggle bold, italic, underline, paragraphs & kbd commands. It gives shortcuts for ordered/unordered lists and row definitions.
The script has commands to insert horizontal rules, line-breaks, and a number of special symbols (just email me to add your favourite).
It has imap mappings that give you ampersands (&&), smart-quotes (single - &' and double &"), <, > symbols, and more. It allow you to insert these and text descriptors or as numbers (for strict XML)
You can close the next open tag (alt-;) or close all open tags at that point (alt->).
Not you may need to remap these for other platforms.
If you have defined 'htmlcmd_AUTOCLOSE' then there is some reasonably intrusive code that will close open tags:
try typing this
This should automatically close the <b>
You can also generate a quick Table Of Contents for your document based on <H1>..<H6> headings. There is a menu item to insert it.. and any options you give
are remembered for when you re-generate the TOC.
GenerateTOC( [<headingtypes>| * ])
:GenTOC [<headingtypes>| * ]
The optional argument is a string of types for each indent level. Eg. " 1ai." would mean level 1 is default (bullet), level 2 is a numbered list, level 3 has letters and level three has roman numerals.
It uses references where it can find them, and generates new ones where it can't.
The arguments supplied are remembered so the TOC can be regenerated without resuplying them.
If * is supplied as an argument, the script prompts for arguments - showing what the current values are.
When used with buffermenu.vim - Menus (for TOC generation) are local to the buffer.
|Use as a filetype plugin (tip - make a directory ftplugin/html and place it in there)
The menu can also work with buffermenu.vim.
By using buffoptions, this should work with version 5.7 and greater as the 6.0 specific plugin-style codes are stripped in the latest version of buffoptions.
Click on the package to download.
ip used for rating: 220.127.116.11
||Added more menus - made them useful for detaching, and able to
customise the name.
||Command :GenTOC added (calls GenerateTOC)
This now remembers the arguments supplied so the TOC can be regenerated without resuplying them.
Also supports * as an argument - providing a Prompt for arguments - showing what the current values are.
||Fixed some maps that didn't have <buffer> specifed. Added <localleader> to replace ',' as prefix. Updated the doco.
Changed the insert-map of '>' to be NOT mapped - define htmlcmd_AUTOCLOSE to map it.
I would like some feedback on the response speed for large documents - any noteable examples would be good.
Also -- any users who need to make modifications due to their setup, I would be interested in hearing from.
Email supplied in script.
||Have redone the auto-closing maps to make them a lot quicker.
Added <m-;> to close a single tag and <m-s-;> to close all tags.
Added a menu for Table Of Contents
||Fixed bug that stopped this working as an ftplugin