User to user discussion and support for UltraEdit, UEStudio, UltraCompare, and other IDM applications.

Syntax highlighting, code folding, brace matching, code indenting, and function list
3 posts Page 1 of 1
I try to organize my language depending template. Two basic questions.

a) Structure:
Is it possible (maybe via editing the XML-file) to create a structure (hierarchy) for the templates like
Code: Select all
Headers:
     Date
     Person
Codefragments
     analyse A
     print B
     write report
Dialogdefinitions
     Inputdialog
     Copyrightdialog


b) Path:
Online help tells me: "language template are stored in standard folder for word-lists" (Sprachtextbausteine werden im Standardverzeichnis für Wortlistendateien gespeichert). This seems strange - my lists are in "c:\Users\....\AppData\Roaming\IDMComp\UltraEdit\templates\language\autolisp-tpl.xml", but my wordfile (and the defined path) is here: d:\Program Files\UE\autolisp.uew
How to move the templates to d:\ too?
UltraEdit 21.00 German / Win 7 x 64 Pro
UltraEdit 24 German / Win 10 x 64 Pro
A hierarchical template list is not possible. The templates are stored in a template file in a flat list.

I recommend for fast inserting templates by key to start the names of all header templates with h, all code templates with c and all dialog definitions with d and avoid non word characters in template names.

Example list:

cAnalyseA
cPrintB
cWriteReport
dInputDialog
dCopyrightDialog
hDate
hPerson

That makes it possible to use Auto-suggest smart template when typing which can be enabled/disabled at Advanced - Settings or Configuration - Templates and inserting templates by key without opening template list view and double click on a template in this view. That makes the usage of smart templates extremely efficient.

But even with template auto-suggest feature not enabled, using CamelCase names with a prefix for grouping them is recommended for efficient usage because of the templates with a name starting with the characters of currently entered word are in the auto-completion list on invoking it.

The auto-completion list can be opened automatically by UltraEdit depending on setting Show auto-complete dialog automatically at Advanced - Settings or Configuration - Editor - Auto-complete or manually at any time hitting Ctrl+Space. The hotkey can be configured at Advanced - Settings or Configuration - Key Mapping containing in Commands list the command AutoComplete.

Try it out with entering just c and hit key Ctrl+Space. The opened auto-completion list contains at top all the configured code fragment templates. Use key Down to navigate in the list and hit key Return or Tab to insert the currently selected template or continue typing in file to reduce the auto-completion list.

The efficiency on inserting templates quickly by key either by using the template auto-suggest feature and/or automatically or manually opened auto-completion list can be lost with no good names for the templates like a space character in a template name before being unique in list because of space is a word delimiter.

Such CamelCase names with a prefix for grouping are used by me since more than 20 years for variables in all scripting/programming languages because of the same reason plus the additional advantage that they can be mixed up with words in explaining comments. I could use as variable name i or index or Index, but finding/replacing this variable in a source code file would be a nightmare. But using iIndex or uIndex (C/C++) or nIndex (JavaScript) as variable makes the coding work much easier. I use meaningful variable names as I rarely need to hit more than 5-8 keys to insert them depending on prefix length.



The default directory for templates is the subdirectory templates in the directory of the INI file which is by default in %APPDATA%\IDMComp\UltraEdit for UltraEdit for Windows because of default INI file location is this directory.

A different INI file directory can be used by using the command line option /i="full path\IniFileName.ini" on starting UltraEdit or using environment variable UEINIDIR. It is still even possible to use the program files directory of UltraEdit for INI file location (as I use), but usually that does not work on using default installation path (as I don't use) and Windows default directory permissions (as I use).

The default directory for wordfiles is the subdirectory wordfiles also in %APPDATA%\IDMComp\UltraEdit, but independent on INI file location (for historical respectively compatibility reasons).

The directory for wordfiles can be configured at Advanced - Settings or Configuration - Editor Display - Syntax Highlighting. But on changing this directory the user must manage the wordfiles completely by oneself which means the user must manually copy *.uew files into this directory, must manually remove them from this directory and must manually update/edit them. This directory can be anywhere (where the user has write permissions). But it is not recommended to use the wordfiles directory in the program files directory of UltraEdit as the *.uew files in this directory are always updated on every install/update of UltraEdit by the installer.

The templates can be also stored anywhere. Advanced - Settings or Configuration - Directories there is the Template directory. I have configured this directory (because of nothing is on my machines as it would be by default for using same paths on all Windows machines independent on Windows version and Windows language.)

Please note that with wordfiles and templates stored outside the directory containing also the INI file, the feature to Backup/Restore User Customizations is less useful.

I don't use %APPDATA%\IDMComp\UltraEdit, but all user configuration files (wordfiles, template files, macro files, script files and all other configuration files) are nevertheless well structured in a directory structure for easy copying/sharing them between my machines and making it very easy to start UltraEdit with default settings which is a special requirement for me.
Best regards from Austria
Hi Mofi

thanks for your in-depth advices.

For the non-existing structure of the templates:
a) There can be created a pseudo-structure, using "Templates" which consists only of their formatted pseudo-title. This title can be mis-used as caption of the section:
Code: Select all
___ Header templates ___
Date
Person
___ Codefragments ___
analyse A
print B
write report
___ Dialogdefinitions ___
Inputdialog


But this does not change the other aspects of your advices.

b) I will make a suggestion to IDM.
UltraEdit 21.00 German / Win 7 x 64 Pro
UltraEdit 24 German / Win 10 x 64 Pro
3 posts Page 1 of 1
cron