Indenting and matching tag on HTML files

Indenting and matching tag on HTML files

1
NewbieNewbie
1

    Jul 16, 2006#1

    1. The remove indents and add indents - in UE they do not do what I need. Every time I want to indent a block and use it UE asks me how many spaces in a popup box. What I need is to be able to set/config the number of spaces as a preset default - I do not want to reset value this every time I use the tool. Usually an editor will have this preset as the number of spaces to indent - and this value is used for any indenting of code auto or any tool. Need it bad else I'm going to be slowed down.

    2. I see the folding, so matching html tag pairs will fold. A similiar capability is to "go to the matching tag", so eg. I have an opening tag and way down in the file I have the closing tag if I do the " tag mate" command the editor will goto (take the cursor/scroll) to the mated tag - this is quite handy - how do I do this? Eg. <table> then find the mate </table> somewhere down in the file.

    Thank you

    6,683583
    Grand MasterGrand Master
    6,683583

      Jul 16, 2006#2

      1. Specify at Configuration - Editor - Word Wrap/Tab Settings the indent space value you want. You can specify different values based on the file extension. See also the help about this configuration page.

      Now you can indent a SELECTION with the TAB key and unindent it with Shift+Tab or use the ReIndent Selection feature from menu Format.

      Add/Remove Indents are for general usage for files without special indent setting or a file has indents but with the wrong number of indent spaces and you want to reformat it. They can be also used for just inserting or deleting preceding white-spaces.

      Next turn on at Configuration - Editor - Display - Formatting the option Auto Indent. The indent and unindent strings for this feature are specified in the wordfile for every language with a syntax highlighting definition, if you have to to modify it to your needs. See also help about Syntax Highlighting.


      2. UltraEdit is a general text editor and not an editor designed for editing HTML files only. Although there are some features especially for editing HTML files like the multi-language syntax highlighting feature and the builtin code folding feature, a "go to the matching tag" feature is not available. Sure, the builtin code folding feature for HTML knows some block elements like <p></p>, <table></table>, etc., but all inline elements are for example not supported.

      At Finding matching tag and How to Select all chars between 2 html tags? you can read about possible workarounds. They are not 100% perfect because they will fail in case of nested elements, but better than nothing.

      UEStudio has more features for HTML editing, for example the Close Tag feature which finds the nearest unclosed tag and closes it.


      Here are indent and brace strings definitions for HTML which you can put into the wordfile for HTML syntax highlighting replacing

      Code: Select all

      /Indent Strings = "<"
      /Unindent Strings = "</"
      /Open Brace Strings =  "{" "(" "[" "<"
      /Close Brace Strings = "}" ")" "]" ">"
      by following:

      Code: Select all

      /Indent Strings = "<blockquote>" "<blockquote" "<body>" "<body" "<colgroup>" "<colgroup" "<dd>" "<dd" "<dir>" "<dir" "<div>" "<div" "<dl>" "<dl" "<dt>" "<dt" "<fieldset>" "<fieldset" "<form" "<frameset" "<head>" "<iframe" "<li>" "<li" "<map" "<menu>" "<menu" "<noframes>" "<noscript>" "<ol>" "<ol" "<optgroup" "<script>" "<script" "<select" "<style>" "<style" "<table>" "<table" "<tbody>" "<td>" "<td" "<tfoot>" "<th>" "<th" "<thead" "<tr>" "<tr" "<ul>" "<ul"
      /Unindent Strings = "</blockquote>" "</body>" "</colgroup>" "</dd>" "</dir>" "</div>" "</dl>" "</dt>" "</fieldset>" "</form>" "</frameset>" "</head>" "</iframe>" "</li>" "</map>" "</menu>" "</noframes>" "</noscript>" "</ol>" "</optgroup>" "</script>" "</select>" "</style>" "</table>" "</tbody>" "</td>" "</tfoot>" "</th>" "</thead>" "</tr>" "</ul>"
      /Open Brace Strings = "<a" "<abbr>" "<abbr" "<acronym>" "<acronym" "<address>" "<address" "<b>" "<b" "<bdo" "<big>" "<big" "<blockquote>" "<blockquote" "<body>" "<body" "<button" "<caption>" "<caption" "<center>" "<center" "<cite>" "<cite" "<code>" "<code" "<colgroup>" "<colgroup" "<dd>" "<dd" "<del>" "<del" "<dfn>" "<dfn" "<dir>" "<dir" "<div>" "<div" "<dl>" "<dl" "<dt>" "<dt" "<em>" "<em" "<fieldset>" "<fieldset" "<font" "<form" "<frameset" "<h1>" "<h1" "<h2>" "<h2" "<h3>" "<h3" "<h4>" "<h4" "<h5>" "<h5" "<h6>" "<h6" "<head>" "<i>" "<i" "<iframe" "<ins>" "<ins" "<kbd>" "<kbd" "<label>" "<label" "<legend>" "<legend" "<li>" "<li" "<map" "<menu>" "<menu" "<noframes>" "<noscript>" "<object" "<ol>" "<ol" "<optgroup" "<option>" "<option" "<p>" "<p" "<pre>" "<pre" "<q>" "<q" "<s>" "<s" "<samp>" "<samp" "<script>" "<script" "<select" "<small>" "<small" "<span" "<strike>" "<strike" "<strong>" "<strong" "<style>" "<style" "<sub>" "<sub" "<sup>" "<sup" "<table>" "<table" "<tbody>" "<td>" "<td" "<textarea" "<tfoot>" "<th>" "<th" "<thead>" "<title>" "<tr>" "<tr" "<tt>" "<tt" "<u>" "<u" "<ul>" "<ul" "<var>" "<var"
      /Close Brace Strings = "</a>" "</abbr>" "</abbr>" "</acronym>" "</acronym>" "</address>" "</address>" "</b>" "</b>" "</bdo>" "</big>" "</big>" "</blockquote>" "</blockquote>" "<body>" "</body>" "</button>" "</caption>" "</caption>" "</center>" "</center>" "</cite>" "</cite>" "</code>" "</code>" "</colgroup>" "</colgroup>" "</dd>" "</dd>" "</del>" "</del>" "</dfn>" "</dfn>" "</dir>" "</dir>" "</div>" "</div>" "</dl>" "</dl>" "</dt>" "</dt>" "</em>" "</em>" "</fieldset>" "</fieldset>" "</font>" "</form>" "</frameset>" "</h1>" "</h1>" "</h2>" "</h2>" "</h3>" "</h3>" "</h4>" "</h4>" "</h5>" "</h5>" "</h6>" "</h6>" "</head>" "</i>" "</i>" "</iframe>" "</ins>" "</ins>" "</kbd>" "</kbd>" "</label>" "</label>" "</legend>" "</legend>" "</li>" "</li>" "</map>" "</menu>" "</menu>" "</noframes>" "</noscript>" "</object>" "</ol>" "</ol>" "</optgroup>" "</option>" "</option>" "</p>" "</p>" "</pre>" "</pre>" "</q>" "</q>" "</s>" "</s>" "</samp>" "</samp>" "</script>" "</script>" "</select>" "</small>" "</small>" "</span>" "</strike>" "</strike>" "</strong>" "</strong>" "</style>" "</style>" "</sub>" "</sub>" "</sup>" "</sup>" "</table>" "</table>" "</tbody>" "</td>" "</td>" "</textarea>" "</tfoot>" "</th>" "</th>" "</thead>" "</title>" "</tr>" "</tr>" "</tt>" "</tt>" "</u>" "</u>" "</ul>" "</ul>" "</var>" "</var>"
      I strongly recommend to remove all strings of which you make never user in your HTML files.

      See Highlight matching HTML tag and Correct reformat of HTML about possible problems using the indent and brace string definitions as posted here.
      Best regards from an UC/UE/UES for Windows user from Austria