Page 1 of 1
making new document open with html syntax as default.
Posted: Thu May 29, 2003 10:29 pm
by neddo
hi there,
I want to be able to open TextPad with HTML syntax highlighting as default [as opposed to plain text highlighting as it does now.]
I tried to move the "*. " document type from text to HTML in the document classes, but this doesn't work.
anybody have any idea how to do this?
thanks,
ned
Posted: Fri May 30, 2003 5:39 am
by Bob Hansen
I don't know how to change the syntax file for the default, but how about making a macro to change the syntax of the current document?
1. Load the document.
2. Run the macro.
Macro does the following:
From the Main Menu select View, Document Properties. go to the tab for Syntax. Be sure to have a check in the box to Enable Syntax Highlighting. In the drop down box for syntax definition file, select (or type in) html.syn. Click on Apply, and OK.
This is a quick and dirty, untested thought
Hope this helps......
Macro to change syntax highlighting
Posted: Thu Jun 17, 2004 9:13 am
by lionelb
I would also like to write a macro to apply a particular syntax highlighting style to the current file (in my case to apply Unix shell script highlighting, as Unix shell scripts tend to be hard to identify automatically by wildcarding).
However, I seem to be unable to record such a macro, since the View/Document Properties menu item is always greyed out when I am recording a macro.
Any help appreciated.
Posted: Thu Jun 17, 2004 11:45 am
by helios
Just for the record, the Document Properties dialog box cannot be used when recording a macro.
In order to have HTML syntax file applied as the default:
From the Configure menu choose:
1. Preferences
2. File
3. Change the Default file extension to HTML
4. Click Apply / OK.
In order to enable the syntax highlighting, you will need to implement the following procedure, as below:
Click on:
1. Configure
2. Preferences
3. Plus sign next to Document Classes
4. Plus sign next to "HTML"
5. Syntax
6. Check the "Enable syntax highlighting" box.
7. Under the heading "Syntax definition file" Select
"html.syn".
8. Click Apply / OK
Please ensure that *.html is a member of the Files in class as follows:
1. Configure
2. Preferences
3. Plus sign next to Document Classes
4. HTML
5. Under the heading "Files in class", make sure that *.html is in the list. If it is not there, then you will need to add it to the list, along with any other file extensions that you are using for HTML files.
6.Click Apply / OK
I hope this helps.
Re: Macro to change syntax highlighting
Posted: Thu Jun 17, 2004 4:16 pm
by lionelb
lionelb wrote:I would also like to write a macro to apply a particular syntax highlighting style to the current file.
helios wrote:Just for the record, the Document Properties dialog box cannot be used when recording a macro.
Hmm... so is this just not possible? Can't think of a workaround, bar waiting for proper scriptable macros...

Posted: Thu Jun 17, 2004 6:10 pm
by s_reynisson
Use html.syn under Configure->Preferences->Document Classes->Text->Syntax. Works for me. HTH
edit: btw, to get those "view code" from the web browsers I have * and *. in my Files in Class HTML.