Skip to content

Sublime Text syntax highlighting

Quan edited this page Sep 5, 2017 · 1 revision

After putting this file in ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User/ and restarting Sublime Text, you see that it appears in the bottom right corner and is automatically applied whenever you open a *.log file.

There is no default *.log syntax highlighting in Sublime Text so this shouldn't clash with anything shipped with stock Sublime Text.

It basically highlights all text after three asterisks *** and before newline, making GSLab log demarcations look snazzy.

screenshot 2017-08-30 15 42 43

Suggested location is keeping it in a gist file and linked to from template README.md. Or maybe we can keep it in a comment (this one) and link to the comment from README.md. Or keep it in README.md but hide it using <details> tag.

File name:gslab_scons_log.tmLanguage

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>fileTypes</key>
	<array>
		<string>log</string>
	</array>
	<key>name</key>
	<string>GSLab Sconstruct Log</string>
	<key>patterns</key>
	<array>
		<dict>
			<key>comment</key>
			<string>Mark GSLAB-raised lines</string>
			<key>match</key>
			<string>\*\*\*(.)*\n</string>
			<key>name</key>
			<string>keyword.other.sconstructlog</string>
		</dict>
	</array>
	<key>scopeName</key>
	<string>source.sconstructlog</string>
	<key>uuid</key>
	<string>ed77d45b-7334-4f32-9e2f-23e212ef4f47</string>
</dict>
</plist>
Clone this wiki locally