Automatically close XML/HTML tags
An UltraEdit user can type the start tag of an HTML element and UltraEdit inserts automatically the appropriate closing tag if that feature is enabled in configuration as by default. That is the most efficient method to write text in HTML embedded in basic tags like <em>
There is by default installed also a tag list file containing the HTML related tag groups HTML - Special Characters
and HTML - Tags
. Those tags can be inserted by opening the Tag List
view and double clicking on a tag in the view. How the view is opened depends on used version of UltraEdit for Windows and the user interface mode not mentioned in initial post. It is possible to select the text before double clicking on an item in this list view which results in enclosing the selected text in the inserted tags as long as the HTML element has a start and an end tag at all.
If the currently used version of UltraEdit was upgraded from an older version and there was never customized the tag groups and tags in the tag list file
, it would be a good idea to make sure using the latest version of the tag list file as installed with UltraEdit and not an older version of the tag list file from an older version of UltraEdit. The necessary steps to manually update the tag list file are for UltraEdit for Windows v2022.1.0.112 as follows:
- Open in UltraEdit the file taglist.uet (ANSI encoded) in program files folder of installed UltraEdit which is by default %ProgramFiles%\IDM Computer Solutions\UltraEdit or %ProgramFiles(x86)%\IDM Computer Solutions\UltraEdit.
- Use the command Save as (key F12) and save the file into the default application data folder %APPDATA%\IDMComp\UltraEdit with the file name TAGLISTU.UET (Unicode encoded) with changing the option Encoding to UTF-16 (with BOM) before clicking on button Save.
- Delete in folder %APPDATA%\IDMComp\UltraEdit the files taglist.uet and taglist.txt which are ANSI encoded versions of the tag list file from older versions of UltraEdit if those files exist at all.
- Restart UltraEdit to load the tags as defined in %APPDATA%\IDMComp\UltraEdit\TAGLISTU.UET.
It is advisable to store customizations not in the file %APPDATA%\IDMComp\UltraEdit\TAGLISTU.UET
although that is possible. I suggest to configure in Tag List Modify
dialog window a different file than the default %APPDATA%\IDMComp\UltraEdit\TAGLISTU.UET
on making customizations like deleting tag groups never needed (for faster load/startup), adding tag groups, adding tags or customizing tags. I use a file with name MyTagList.uet
in folder %APPDATA%\IDMComp\UltraEdit
which is also encoded with UTF-16 with BOM. Right click into the Tag List
view and click on the context menu item Modify tags
to open the Tag List Modify
dialog window which is resizable and where the file with the tag list can be selected.
HTML user tools
The HTML user tools are more or less the same as the tags in the tag list file with the following differences in comparison to the tags:
- There are predefined tags which on insert trigger extra code inside UltraEdit like for the lists to convert a selected text block into a real HTML formatted list.
- The HTML user tools can be customized in configuration at Advanced - Settings or Configuration - Toolbars / menus / HTML user tools with the exception of those with special program code.
- The HTML user tools configuration is stored in %APPDATA%\IDMComp\UltraEdit\ue.ini on using UltraEdit for Windows v2022.1.0.112.
- The HTML user tools have associated icons and the most often need and predefined HTML user tools are shown on ribbon tab Coding (ribbon mode) as well as toolbar HTML user tools (both toolbar/menu modes) whereby the toolbar HTML user tools is by default not visible. The visibility of the HTML user tools toolbar must be toggled on in both toolbar/menu modes.
Please read also HTML toolbar using deprecated elements B and I instead of STRONG and EM (solved)
as the HTML user tools customization is a bit tricky because of the customization is not yet implemented completely again as it was up to UltraEdit for Windows v22.20.
The smart templates replace more or less the older tags in tag list view. A smart template can be inserted also by using a view which is in this case the Template List
view. But one big advantage of a smart template in comparison to a tag is the ability to insert a smart template by typing its name on Auto-suggest smart template when typing
being enabled as by default at Advanced - Settings or Configuration - Templates
Another advantage of smart templates is the possibility to define them with parameters of which values are defined while inserting a smart template.
The indentation can be taken into account on inserting a smart template which is not the case on inserting a tag from the tag list group. Well, the tags in a tag list group are usually not defined as multi-line tags although that is possible and I have defined some tags as multi-line tags in my custom tag list file.
There are four different type of smart templates:
- Global templates are always accessible at any time. It is not possible to turn off suggesting global templates. A good naming scheme for the templates prevents suggesting global templates when not really needed. There can be defined all global templates with a specific prefix in name which can be a string like glb or g_ or just _ or #.
- Language templates are associated with a specific syntax highlighting language. The language templates are accessible if the text at current position of caret in active file is syntax highlighted with the associated syntax highlighting language.
- Project templates are associated with a specific project. Project templates are very useful for HTML writers working for various websites with different cascading style sheet classes. The usage of a project for each website makes it possible to use also smart templates with CSS class references suitable for the website/project currently opened with project template names being identical in all project template files for a similar element. For example the head block of each webpage of website A is different to the head block of each webpage of website B. The smart project template for inserting the head for website A differs for that reason from the smart project template for inserting the head for website B, but the project template name of the template to insert the head block into a new HTML file is the same in all project template files.
The smart language template for HTML installed by UltraEdit contains some predefined templates. But the main advantage of smart templates is the customization to fit exactly to the personal needs. This is the reason why I don't share my templates public with anybody else. My smart templates for batch file coding, C/C++ coding, UltraEdit/UEStudio script coding, HTML files editing for various websites, etc. are all customized perfectly to my requirements and are not of general usage. I use a naming scheme for all my templates making it very efficient for me to insert them by key and nevertheless know at any time which characters to insert into active file (= keys to press) to get the smart template suggested for inserting which I want to insert now from global, layout, language or project templates list.