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
Manual Install
Put the file xah-html-mode.el
in ~/.emacs.d/lisp/
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)
Features
Xah HTML Mode is more advanced than the several HTML modes bundled in GNU Emacs or online.
Visual Validation
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.
Tag Insertion
- 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.
Tag Navigation
- Easily move to previous/next tag, or jump to matching open/close tag.
Tag Manipulation
- 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.
- Disable JavaScript tags of unknown html.
- 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.
Validate HTML/XML
Commands to validate HTML/XML by buffer, file, or whole directory. Based on XML well-formed concept via syntax. Validate 5 thousand HTML files in few seconds.
Fully Documented
Every command has full documentation.
- Alt+x
describe-mode
to see a list of commands. - Alt+x
describe-function
to 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.