Sublime Forum

Creating a very basic highlighter scheme

#1

I’d like to create a very simple highlighter scheme for the people writing our software documentation. All it has to do is:

  1. Any line which starts with # should be one colour
  2. Anytime a specific word + colon appears at the start of a line, that keyword and that colon should have another colour. There’s a list of a couple dozen keywords and they are not case-sensitive

So the result I’m after should look like:

file written on 2014/02/03

file written by David R

Author: David
Autolink: Yes
Title: How to write a new syntax highlighter
Content: Line 1.
Line2.
Line3.
Line4.

SeeAlso: The sublime forum
MSDN
Google

Is there a similar highlighter available that I can easily change, or should I write one from scratch, or…?

0 Likes

Custom syntax highlighting for bukkit log parse
Customer some rule for syntax highlight and function list
#2

dl.dropboxusercontent.com/u/930 … tmLanguage

0 Likes

#3

Yes! Thank you.
This is working great.

0 Likes

#4

hi:
Would you please tell me how to use the content in dl.dropboxusercontent.com/u/930 … tmLanguage ?

Thanks.

0 Likes

#5

You download it to (Preferences -> Browse Packages) then navigate to User/ folder. As… …/Packages/User/OurSoftwareDocumentation.tmLanguage

Then open a file, and from the statusbar, change the syntax from plain text or HTML to “OurSoftwareDocumentation”

0 Likes

#6

Thanks for your quickly reply.

Now I need to create my own scheme:

I create a file named test.hit, and i created a file named Hit.tmLanguage in the \packages\user,

But when I open the test.hit in sublime, It will not automatically use the scheme, I need to switch it manually.

How can I make sublime to use the scheme according to the file extension?

0 Likes

#7

In the same menu to change the syntax there is a submenu named “Open all with current extension as…”

0 Likes

#8

Thanks, it works.

Now I need sublime to list my functions in the Goto Symble window, my function defines like:

function write_log( integer log_level,string logstr )
xxxx;
endfunction

Can the scheme help to do this kind of work?

0 Likes

#9

That’s a different topic, search for a thread, or start a new one.

0 Likes