Emacs: Xah HTML Mode (xah-html-mode.el)
is a emacs major mode for HTML.
Get it by Donation
Goto paypal.com, send $32 to Xah@XahLee.org (be sure to include your correct email address. I need that to send it to you.)
Write in message area: xah html mode
Put the file
Put all dependent files in that dir. (included)
Put this in your Emacs Init File:
(add-to-list 'load-path "~/.emacs.d/lisp/") (require 'xah-html-mode)
Xah HTML Mode is more advanced than the html mode bundled in gnu emacs. It does not use gnu emacs html mode code.
Syntax coloring based on visual code validation. The colors tells you if you have the correct syntax. Including, invalid/typo tag names, attribute names, or missing angle brackets.
- Easily insert any tag.
- If there is a text selection, the tags are wrapped around it.
- If there is no text selection, the tags are smartly wrapped around word, line, or text block, depending on the tag. Or, on empty line, insert the tag pair with cursor moved inbetween.
- Optionally add id or class tags.
Besides a generic command to insert tag, there are also commands dedicated to special tags:
- Convert text blocks to paragraphs.
- Convert lines to list, definition list, table.
- Convert image path to embedded image.
- Easily move to previous/next tag, or jump to matching open/close tag.
- Select by element structure. (repeated call expand to parent element.)
- Delete current tag pair
- Delete all tags in a selection.
- Command to join elements.
- Command to change an element (opening tag and closing tag).
- Extract URL in a text selection.
- Replace HTML entities to unicode characters or reverse.
- Percent encode/decode URL.
- Reformat single-line html file to be readable.
- Convert list to lines.
- Convert table to lines.
- Convert html text to plain text.
Most Efficient Key System
- Keys are based on key sequence. No need to hold Control key.
- The most frequently used command have easy keys.
- The keys can be easily customized.
Commands to validate html/xml by buffer, file, or whole dir. Based on XML well-formed concept via syntax.
Every command has full documentation.
describe-modeto see a list of commands.
describe-functionto see any command's inline doc.
Support for Embeded Programing Language Source Code
Full featured support of embeded programing language source code, similar to org mode's babel feature.
- HTML syntax color embedded programing language source code.
- Extract programing language source code into a separate buffer for edit and eval.
Xah HTML Mode Tutorial