Edited on 2010-03-02:
Starting with UltraEdit v16.00 there are the commands Edit - Comment Selection
and Edit - Uncomment Selection
to insert/remove block comment on/off strings on the current selection and the methods described below are not needed anymore.
First paragraph in help on page Comment Add/Remove commands (Edit menu)
(with extra highlights for you):
These commands allow line comments (as defined in Syntax Highlighting) to be added to or removed from the selected lines. The file being edited must be enabled with Syntax Highlighting and line comments must be defined for the particular language.
CSS has no line comment, only a block comment!
You have 3 possibilities to comment a CSS selection with a key hit.
- Using a template
First in the Directories Configuration dialog specify a directory where the template file should be created which is then always automatically loaded on startup of UE.
Next click on Advanced - Display/Modify Templates, enter for example "CSS comment" as template name, enter in the large edit field
/* [$replace$] */
remember the template number currently selected (0 by default) and close the dialog with OK to save the template.
In the Key Mapping Configation assign a key you want for command InsertTemplatex.
- Using a macro
Use a macro with a hotkey saved in a macro file which is specified to be automatically loaded on startup of UltraEdit. The macro code is for example:
- Using a tag
This solution does not support a hotkey!
Open the Tag List View in menu View - Views/Lists.
Click with right mouse button on the list and choose Modify Tags.
Click on button New Group to create a new group for CSS.
Then enter at Description for example "CSS comment", in Begin Tag "/* " (without the ") and in End Tag " */".
Add the tag to the new group. Maybe you want to add additional CSS related tags too. When finished close the dialog with OK.
Now if you have selected one or more lines or only a few words and double click in the tag list for CSS on "CSS comment", the block comment characters are inserted around the selection. If nothing is selected, the comment characters are simply added. So the handling is the same as with a template, but without the possibility to assign a hotkey for the tag.
For more details about all written above see help of your UE and read it carefully.