Lugaru's Epsilon
Programmer's
Editor 14.04

Context:
Epsilon User's Manual and Reference
   Commands by Topic
      . . .
      Changing Text
         Inserting and Deleting
         Killing Text
         Clipboard Access
         . . .
         Hex Mode
      Language Modes
         . . .
         Configuration File Mode
         GAMS Mode
         HTML/XML/CSS Modes
         Ini File Mode
         Makefile Mode
         . . .
      More Programming Features
         Navigating in Source Code
         Pulling Words
         Accessing Help
         Context-Sensitive Help
         Commenting Commands
      . . .

Previous   Up    Next
GAMS Mode  Commands by Topic   Ini File Mode


Epsilon User's Manual and Reference > Commands by Topic > Language Modes >

HTML/XML/CSS Modes

Epsilon automatically enters HTML mode when you read a file with an extension of .htm, .html, .shtml, .cfml, .cfm, .htx, .asp, .asa, .htt, .jsp, .prx, .cfc, .asx, .ascx, or .aspx. It uses XML mode when you read a file with an extension of .xml, .cdf, .osd, .wml, .xsl, .xst, .xsd, .xmp, .rdf, .svg, .rss, .xsdconfig, .ui, .xaml,, .sgml, or .sgm, or when a file identified as HTML has contents that suggest XML. Everything about HTML mode below also applies to XML mode.

In HTML mode, Epsilon does appropriate syntax highlighting, smart indenting, and brace-matching. The commenting commands and find-linked-file work too. If a file contains embedded blocks of CSS or scripting using JavaScript, VBScript, Python, and PHP, Epsilon colors them appropriately, and features like indenting switch to the rules for those languages within such blocks.

The html-auto-fill-mode variable controls whether Epsilon automatically breaks long lines as you type. One bit disables this entirely, while others let you customize which lines Epsilon can split (along with the html-auto-fill-combine variable). The html-auto-indent variable controls when Epsilon indents these new lines (as well as lines you create by pressing <Enter>).

For XML mode, Epsilon uses the xml-auto-fill-mode, xml-auto-fill-combine, and xml-auto-indent variables instead.

The html-indenting-rules variable controls whether and how Epsilon does smart indenting. The html-indent variable sets the width of each level of indentation in HTML text; xml-indent is used for XML.

The html-no-indent-elements variable lists HTML elements whose contents shouldn't receive additional indentation, and the html-paragraph-is-container buffer-specific variable helps Epsilon indent <p> tags correctly. Epsilon uses the html-empty-elements and coldfusion-empty-elements variables to decide which elements never use end tags. The html-paragraph-elements variable (xml-paragraph-elements in XML) sets which tag names serve as paragraph delimiters for fill-paragraph. The html-style-rules variable can be set to require that all empty elements use self-terminating tags.

The html-reindent-previous-line variable, or for XML mode, the xml-reindent-previous-line variable, controls whether those modes reindent the current line when you press <Enter>.

When an HTML or XML file contains embedded scripting, Epsilon must determine its language. If the file itself doesn't specify a language (using a syntax like <script language=jscript> or <?php ?>, for instance), then Epsilon consults one of several variables to choose a default script language. Each of the variables in the table may be set to 1 for Javascript-style coloring, 2 for VBScript-style coloring, 3 for PHP-style coloring, 4 for Python, 5 for CSS, 10 to ignore those block start delimiters, or 0 for plain coloring of the block.

 Variable  Default  Embedding Syntax
 
 html-asp-coloring  JavaScript  <% %> (in HTML mode)
 html-php-coloring  PHP  <? ?> (in HTML mode)
 xml-asp-coloring  Ignore  <% %> (in XML mode)
 xml-php-coloring  Ignore  <? ?> (in XML mode)
 html-other-coloring  JavaScript  <script language=unknown>

You can disable coloring of embedded scripting in cases where the script language is explicitly specified by setting the html-prevent-coloring variable.

As you move about in an HTML or XML buffer, on the mode line Epsilon displays the innermost tags in effect for the start of the current line. (The html-display-nesting-width variable influences how many tags will be shown.) It shows an open < to indicate the line begins inside a tag, or ? to indicate a syntax problem with the tag such as a missing >. Within embedded scripting, it displays the current function's name, or the type of scripting. Set the html-display-definition variable to customize this.

When the cursor is on a < or > character, Epsilon will try to locate its matching > or < and highlight them both. If the current character has no match, Epsilon will not highlight it. Within a start tag or end tag, Epsilon will use color to highlight it and its matching tag, using a different color to indicate a mismatched tag. Set the variable auto-show-html-delimiters to customize this.

Press Alt-Shift-L to display a list of all mismatched start or end tags in the current buffer. The list appears in a grep buffer. See the grep-mode command for navigation details.

When the cursor is at a start tag, you can press Alt-= to have Epsilon move to its matching end tag, and vice versa.

Press Alt-Shift-F to move to the end of the current tag. If the tag is a start tag, Epsilon moves to the end of its matching end tag. Press Alt-Shift-B to move to the start of the current tag. On an end tag, it moves to the beginning of its matching start tag. Outside a tag, both commands move by words.

Press Alt-Shift-D to delete the current tag, and if it has a matching end or start tag, that tag as well. Alt-Shift-E inserts an end tag for the most recent start tag without one.

Mainly useful for XML, the Alt-Shift-R key sorts the attributes of the current tag alphabetically by attribute name. With a highlighted region, it sorts the attributes of each tag in the region, then aligns corresponding attributes so they start at the same column in each tag.

Press Alt-i to display the element nesting in effect at point. This is similar to the information Epsilon displays in the mode line, but more complete. One difference: while the automatic mode line display shows nesting in effect at the beginning of the current line, and doesn't change as you move around within a line, this command uses the current position within the line.

Epsilon can create an HTML version of syntax-highlighted text that preserves its colors. See the copy-formatting-as-html command.

See PHP Mode for the similar PHP mode. Also see Internet Support for information on viewing http:// URLs with Epsilon.

Epsilon enters CSS mode when you read a file with a .css extension. It also uses a flavor of CSS mode when cascading style sheet code is embedded in an HTML file. CSS mode provides syntax highlighting, commenting, smart indenting using the css-indent variable, and delimiter highlighting using the auto-show-css-delimiters variable.

Standard bindings:

    html-mode
   xml-mode
   css-mode
 HTML/XML only: Alt-=  html-find-matching-tag
 HTML/XML only: Alt-i  html-list-element-nesting
 HTML/XML only: Alt-Shift-F  html-forward-tag
 HTML/XML only: Alt-Shift-B  html-backward-tag
 HTML/XML only: Alt-Shift-D  html-delete-tag
 HTML/XML only: Alt-Shift-E  html-close-last-tag
 HTML/XML only: Alt-Shift-L  html-list-mismatched-tags
 HTML/XML only: Alt-Shift-R  xml-sort-by-attribute-name
 



Previous   Up    Next
GAMS Mode  Commands by Topic   Ini File Mode


Lugaru Epsilon Programmer's Editor 14.04 manual. Copyright (C) 1984, 2021 by Lugaru Software Ltd. All rights reserved.