index

Settings

With the standalone application you can customize the settings.

It is possible to set the preferences for all supported file type (General tan). Then you can override single settings for customize only the output for some specific source format (Formats tab).

You can show advanced settings using the relative command on the view menu.

The settings are stored in ~/Library/Preferences/org.sbarex.SourceCodeSyntaxHighlight.plist. Customized themes and styles are saved in ~/Library/Application Support/Syntax Highlight/Themes|Styles folders.

General settings

General Settings Window

You can set the settings for all supported formats on the General tab.

Settings Description Advanced
Render engine Engine used to render the highlighted code. The suggested engine is RTF. Use the HTML engine only if you want to use a custom CSS to override the color schema (or you have choose a theme with some extra CSS inside it). Advanced users must use the HTML engine to handle the hover functionality of a Language Server or to include a .lua plugins that require interactive javascript code.
(corresponds to --out-format highlight argument)
Color schema Chose the color schema for light and dark appearance.
(corresponds to --style highlight arguments)
Font You can chose a preferred font or use the standard monospaced font.
(corresponds to --font and --font-size highlight arguments)
Word wrap Allow to handle word wrap for long lines. Hard wrap break the line after a fixed length (can cause some highlight glitch). Soft wraps allow to break the line at the preview windows width. When word wraps is disabled, you can only enable it for minified files that have only one line. One line file detection is done on the source file and not on the preprocessor output.
(corresponds to -V, -W and --line-length highlight arguments)
Line numbers Allow to show the line numbers.
(corresponds to --line-numbers and --wrap-no-numbers highlight arguments)
Tabs to spaces Allow to translate tabs to spaces. Set to zero to use tabs.
(corresponds to --replace-tabs highlight argument)
Extra highlight arguments Additional standard argument passed to highlight. Arguments that contains a white space must be protected inside quotes. See man highlight to a list of valid arguments and plugins.
Eg: --doc-title='title with space'
Yes
Custom CSS Style If the render engine is set to HTML allow to define a custom CSS style to override/extend the color schema. Yes
Interactive preview If the render engine is set to HTML enable the javascript interpreter inside the preview window. Use only if you use some highlight plugins that output javascript code. This option disable the possibility to move the Quick Look preview with click and drag inside the window and opening the file with a double click. Yes
Data limit Maximum amount of data to format, data beyond the limit is omitted. Specify 0 to not limit. This option is ignored when using a Language Server.
Note that if for a format is defined a preprocessor the filter is applied to the his output and not to the source file.
Convert line ending Allow to convert Windows (CRLF) and Mac Classic (CR) line ending to the Unix style (LN). This option is ignored when a preprocessor is set or when a Language Server is enabled. The line ending conversion is made my Dos2unix. Yes
Debug If enabled, a colorize.log and colorize.rtf\|html file will be created on your Desktop folder with the log of last rendering. Yes

Format settings

Settings Window for specific format

You can override the global options for some formats on the Formats tab.

From the list on the left side you can choose the source file format.

For an explanation on the behavior of file types click here.

The gray-out items on the list are those currently managed by others UTI. .

For every single format in addition to the global settings there are also these extra options:

Settings Description Advanced
Append highlight arguments Arguments appended to the Extra highlight arguments. Arguments that contains a white space must be protected inside quotes. Yes
Preprocessor Set a program or a shell script to preprocess the source file before the formatting. The program must output to stdout the data to be passed to highlight. You must pass the name of the source file using the $targetHL placeholder. With the preprocessor you can handle file format not directly supported by highlight. This option is ignored when using a Language Server. The execution of the preprocessor is made inside the same env of the script that handle highlight.
envnote
logHLIf it is not empty set the path of the log file.
targetHLPath of the file to colorize.
pathHLPath of the highlight executable.
cmdOptsHLArray with the arguments passed to the highlight executable.
themeHLHighlight theme to be used.
syntaxHLIf it is defined force the use of this language to recognize the target file.
maxFileSizeHLIf it is defined, is the file size limit (in bytes) after apply a trim. The limit is applied to the output of the preprocessor and not to the contents of the source file.
Yes
Syntax Set which language must be used to recognize the source file. If not set will be used the file name extension (corresponds to --syntax highlight arguments). Yes

Advanced users can customize the single format to use an external Language Server:

Settings Description Advanced
Executable Full path of the Language Server executable. Yes
Delay Server initialization delay in ms. Yes
Syntax Syntax which is understood by the server. Yes
Hover Execute hover requests. Require the HTML render engine. Yes
Semantic Retrieve semantic token types (the Language Server must implement the protocol 3.16). Yes
Syntax Error Retrieve syntax error information (assumes hover or semantic). Yes
Options Custom command line options to pass to the Language Server. Yes

When using an external Language Server the preprocessor and the data limit settings are ignored.

Some format have a preconfigured custom settings to handle the data (for example java compiled class file can be decompiled before render).

Inside the folder ~/Library/Application Support/Syntax Highlight/defaults/ (you may need to create it if is missing), you can also put a custom settings for specific UTI format creating a plist file named with the UTI value.
The plist can have any of this settings:

nametype
preprocessorstring
syntaxstring
extrastring