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
8 posts Page 1 of 1
All I am trying to do is highlight # in a txt file. I write a lot of things to do in my txt file, and use ####### to separate each section. The highlight color I wanted to use was RED. Below is what I'm trying to do, I'm a new with this wordfile list.

##############
Merchant Account - Company Name
http://www.BLAH.com/
id: BLAH
pw: BLAH
What city were you born in?
Answer: BLAH
##############
Open Configuration - Editor Display - Syntax Highlighting. There you see the currently used wordfile. Open it with clicking on the button Open and close the configuration dialog with Cancel.

Search in the file for last occurence of a line starting with /Lxx"...". Remember the number xx and then set the cursor to end of the file.

Insert at the end following language definition to highlight # in files with the extension TXT (or txt or Txt ... it is not case-sensitive).

/Lxx+1"Text files" Nocase Noquote DisableMLS File Extensions = TXT
/Delimiters =  tab#
/C1"Section Line #"
#

xx+1 is next number after the last language definition number you found before.

Note: After /Delimiters = 2 spaces and a tab character (here displayed as tab) must be specified before character #.

Now use command Save As to save the wordfile with a new name. That is better because standard wordfile.txt is also updated during updates of UltraEdit. Although you will be asked and a backup is created, many users don't recognize that during the installation of an update.

Next use Edit - Copy File Path/Name to copy full file name of the new wordfile to the Windows clipboard.

Open again Configuration - Editor Display - Syntax Highlighting, select the full file name of the wordfile in the edit field and press Ctrl+V to overwrite it with the name of the new wordfile. Press OK. Reopen the configuration dialog and select now Language Text files and then Color Group Section Line # and specify the red color for it.

That's it.

The syntax highlighting configuration dialog also has the button Help which opens the big help page about syntax highlighting where you can read anything about how the syntax highlighting works.
Yeah I just noticed the help file, but what you told me worked like a charm and is allowing me too understand how it works for deeper control of a txt file for highlighting items I need highlighted. Thank you very much for your help.
So how do you use this idea for syntax highlighting a tab character? I placed "tab" and the actual tab key press after the # and I can't get the tab character to highlight. I am using tab delimiting, by the way, and wanted an easy way of trouble shooting a text file with tab delimiting for importing into a database table. Also, the language does not show up as text file, but as Language 15. How do I fix this?

Thanks
The tab character is a whitespace character and the whitespace characters space and tab are delimiter characters inside the wordfile. Therefore it is not possible to define a tab character as "word" to be syntax highlighted.

But there is no need to use a syntax highlighting wordfile for highlighting tabs and spaces. Simply enable View - Show Spaces/Tabs and use View - Set Colors - Spaces, Tabs, Line Ends to define the foreground color for the replacement characters in this special view mode.
Bummer. Yeah, I have them displayed, but they were light grey and was hoping to have them more visible. Oh, I see, yes, I changed them from light grey to pink and can see them better now. Thank you for the answer!
Mofi wrote: The tab character is a whitespace character and the whitespace characters space and tab are delimiter characters inside the wordfile. Therefore it is not possible to define a tab character as "word" to be syntax highlighted.

But there is no need to use a syntax highlighting wordfile for highlighting tabs and spaces. Simply enable View - Show Spaces/Tabs and use View - Set Colors - Spaces, Tabs, Line Ends to define the foreground color for the replacement characters in this special view mode.

Mofi, this answer was posted in 2011. Six years later, I'm using version 23.00.0.43 and the elements of the View menu have changed. Set colors no longer appears as an option. Do you know if there is still a way to change the color of these characters? I'm finding it difficult to see them because they are a very light gray against a white background. I can make out the line terminators, but the spaces and tabs are very small.

I've searched in the UE forums, and on Stack Overflow and haven't found anything more recent than your reply above. I'm hoping you or someone else has found a way to do this. Any suggestions would be appreciated. Thanks.
P Bartells
Irving, TX
It is of course possible to change the color for Spaces, tabs, line ends on tab Editor in Manage Themes dialog introduced with UltraEdit for Windows v20.00 and UEStudio v14.00 opened

  • in ribbon mode by clicking on ribbon tab Layout in ribbon group Look and feel on Themes item (second from left) or on down arrow below Themes and next on popup menu item Manage themes,
    or
  • in toolbar/menu mode with contemporary menus (the only toolbar/menu mode in UE v23.00 and v23.10 respectively UES v16.00 and v16.10) in menu Layout in submenu Themes on menu item Manage themes,
    or
  • in toolbar/menu mode with traditional menus (available since UE v23.20 and UES v16.20) in menu View in submenu Themes on menu item Manage themes.
The big advantage in comparison to former color configuration dialogs is that each change is immediately applied to underlying windows even without clicking on button Apply or OK with magnifying glass button in bottom left-hand corner being enabled as by default.
Best regards from Austria
8 posts Page 1 of 1