File Type Colors and Syntax

On the Colors and Syntax page in the file types configuration screen, you can configure the syntax coloring and bracket matching text editing aids.

Syntax Coloring

Syntax coloring highlights different parts of a file in different colors. This makes it easier to edit text files that need to adhere to a certain syntax or formatting, such as programming source code or markup files. The different colors help guide your eyes through the structure of the file.

In EditPad, the actual highlighting is determined by a combination of two settings. The "color palette" associates named colors with actual red-green-blue colors. Select the palette that best matches your color preferences. Click the Customize button next to the drop-down list with color palettes to edit the individual colors. The list of palettes is shared by all file types. If you edit a palette used by multiple file types, the changes apply to all those file types.

The "syntax coloring scheme" uses the named colors to highlight different parts of the file. EditPad Pro ships with many syntax coloring schemes for a variety of file formats and programming languages. Simply select the one you want to use from the "syntax coloring scheme" drop-down list. Select "none" at the top of the list if you want to disable syntax coloring.

Applying syntax coloring to an entire file takes up too much time and memory for very large files. For files larger than the huge files threshold set in the Open Files Preferences, EditPad Pro automatically disables syntax coloring schemes that require the entire file to be processed. If you selected such a scheme in the "syntax coloring scheme" drop-down list, you can select an alternative scheme in the "syntax coloring scheme for huge files" drop-down list. This second list only shows schemes that do not highlight anything that might span more than one line. This means the scheme only needs to process the visible part of the file. It can instantly apply syntax coloring to files of any size.

Some of the syntax coloring schemes supplied with EditPad Pro come in two versions, one if which is marked (fast). The regular scheme supports the full syntax of the programming language or file format it is intended for, but cannot be used with huge files. The (fast) scheme does not highlight things that span multiple lines, and works with files of any size. For example, the "XML" scheme handles the full XML syntax. The "XML (fast)" scheme highlights everything except comments and CDATA sections that span multiple lines. If a scheme supplied with EditPad Pro is available for huge files and is not marked (fast), that means that the scheme handles the full syntax of the programming language or file format that it is intended for. For example, batch files themselves are line-based, so the scheme for batch files never needs to highlight something that spans multiple lines.

If no coloring scheme is available for the file type you are defining, click the download button. EditPad Pro will then connect to the Internet and allow you to download many custom syntax color schemes created and shared by other EditPad Pro users. To create your own syntax coloring schemes, use the Custom Syntax Coloring Scheme Editor. After editing a scheme or creating new ones, click the Refresh button to make EditPad Pro read in the new and edited schemes.

Turn on "highlight matching brackets touched by the cursor" to highlight the bracket touched by the cursor and that bracket's corresponding opening or closing bracket. The cursor touches a bracket when it is positioned immediately to the left or right of the bracket. If the bracket consists of multiple characters, the cursor also touches it if it is positioned between two characters that are part of the bracket. If the cursor touches two brackets at the same time that belong to different pairs, the bracket to the right of the cursor is highlighted. If the corresponding bracket is missing, the bracket touched by the cursor is highlighted by itself, in a different color.

Turn on "highlight innermost pair of brackets containing the cursor" to highlight the pair of opening and closing brackets nearest to the text cursor that surround the text cursor. Brackets surround the cursor if the cursor is positioned to the right of the last character in the opening bracket and to the left of the last character in the closing bracket. If the innermost pair of matching brackets contains an unmatched opening bracket to the left of the cursor or an unmatched closing bracket to the right of the cursor, then that unpaired bracket is highlighted alone in a different color and the innermost pair is not highlighted.

If you turn on both bracket highlighting options, then touching brackets are highlighted if the cursor touches a bracket. The innermost pair containing the cursor is highlighted if the cursor does not touch any brackets.

Exactly which brackets are highlighted and how they are paired up depends on the syntax coloring scheme the file type uses. If the syntax coloring scheme does not define any bracket pairs, EditPad matches up nested pairs of (), [], and {} throughout the file. The provided syntax coloring schemes for programming languages match up these brackets too, depending on how they are used in the programming language. They also match up quotes that are used to delimit strings and characters that delimit multi-line comments. Syntax coloring schemes for markup formats such as HTML and XML match up HTML and XML tags.

EditPad Pro can also apply live spell checking. When you activate the "live syntax-aware spell checking" option, EditPad Pro will mark misspelled words as you type. By default, misspelled words are marked in red and underlined. You can change the look in Colors Preferences. The live spell checking is syntax-aware. This means that the spell checker will work together with the syntax coloring scheme, and only check parts of the file that are likely to contain text in a human language (English). E.g. if you are programming in C# or Java, the spell checker will only check the text in comments and strings. Comments and strings are likely to contain human language, while the rest of the file is in the C# or Java programming language.

The spell checker will only work if you have previously downloaded and installed Just Great Software spell checker dictionaries. Click the Download Spell Checker Dictionaries button to download some or all of the spell check dictionaries free of charge.

Clip Collection

You can specify a default Clip Collection to be used for each file type. If you activate a file that has a Clip Collection associated with its file type, that collection is automatically opened. By using different collections for each file type, you always have the appropriate text snippets at your fingertips. E.g. you could associate the HTML file type with a collection with HTML tags, and the Java source code file type with your favorite Java code snippets.

EditPad Pro automatically saves modified collections. If you already have a collection open when activate a file that has a Clip Collection associated with its file type, the collection that was already open is automatically saved before opening the file type's collection.