Highlighting for txt file

Syntax highlighting, code folding, brace matching, code indenting, and function list

Highlighting for txt file

Postby pizarn » Fri Sep 07, 2007 8:49 pm

All i am trying to do is highlight # in a txt file. I write alot of things to do in my txt file, and use ####### to seperate each section. The highlight color i wanted to use was RED. Below is what im trying to do, im 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
##############
User avatar
pizarn
Newbie
 
Posts: 2
Joined: Thu Sep 06, 2007 11:00 pm

Re: Highlighting for txt file

Postby Mofi » Sun Sep 09, 2007 3:13 pm

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

Re: Highlighting for txt file

Postby pizarn » Tue Sep 11, 2007 5:24 pm

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.
User avatar
pizarn
Newbie
 
Posts: 2
Joined: Thu Sep 06, 2007 11:00 pm

Re: Highlighting for txt file

Postby Twilightmist » Tue Mar 15, 2011 1:52 pm

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
Twilightmist
Newbie
 
Posts: 2
Joined: Tue Mar 15, 2011 1:48 pm

Re: Highlighting for txt file

Postby Mofi » Wed Mar 16, 2011 1:06 am

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

Re: Highlighting for txt file

Postby Twilightmist » Wed Mar 16, 2011 1:59 pm

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!
Twilightmist
Newbie
 
Posts: 2
Joined: Tue Mar 15, 2011 1:48 pm


Return to Syntax Highlighting