Indenting and matching tag on HTML files

This forum is user-to-user based and not regularly monitored by IDM.
Please see the note at the top of this page on how to contact IDM.

Indenting and matching tag on HTML files

Postby leegold58 » Sat Jul 15, 2006 8:10 pm

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
User avatar
leegold58
Newbie
 
Posts: 1
Joined: Fri Jul 14, 2006 11:00 pm

Re: Indenting and matching tag on HTML files

Postby Mofi » Sun Jul 16, 2006 2:25 pm

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.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4055
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna


Return to UltraEdit General Discussion