making new document open with html syntax as default.

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
neddo
Posts: 1
Joined: Thu May 29, 2003 10:23 pm

making new document open with html syntax as default.

Post 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
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post 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......
Last edited by Bob Hansen on Thu Jun 17, 2004 3:49 pm, edited 1 time in total.
Hope this was helpful.............good luck,
Bob
User avatar
lionelb
Posts: 34
Joined: Fri Mar 19, 2004 11:58 am
Location: Brighton, UK

Macro to change syntax highlighting

Post 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.
Lionel B
User avatar
helios
Posts: 711
Joined: Sun Mar 02, 2003 5:52 pm
Location: Helios Software Solutions
Contact:

Post 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.
Helios Software Solutions
User avatar
lionelb
Posts: 34
Joined: Fri Mar 19, 2004 11:58 am
Location: Brighton, UK

Re: Macro to change syntax highlighting

Post 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... :?
Lionel B
User avatar
s_reynisson
Posts: 939
Joined: Tue May 06, 2003 1:59 pm

Post 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.
Then I open up and see
the person fumbling here is me
a different way to be
Post Reply