File Type Colors and Syntax

On the Colors and Syntax page in the file type configuration, you can configure whether EditPad applies any syntax coloring to your files.

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 then 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.

If no syntax coloring scheme is available for the file type you are defining, click the download button. EditPad Pro then connects to the Internet and allows 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.

Because color palettes are separate from syntax coloring schemes, anyone can easily customize EditPad’s colors to their taste by customizing one color palette. They can use the same palette with all their file types and have consistent and pleasing colors for all files. There is no need to edit any syntax coloring schemes, which is much harder than customizing a palette, just to change some colors. If you create a syntax coloring scheme for a file format not supported by EditPad, make sure that your scheme uses the named colors in a logical way so that it looks good with the palettes included with EditPad Pro. Then it will also look good with the custom palettes of anyone who might use your scheme.

Huge Files

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 then 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 of 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.

Files without Line Breaks

Some files may not have any line breaks at all when they are computer-generated. XML and JSON files are prime examples. Files without line breaks are very cumbersome to work with in a text editor. EditPad Pro can automatically add line breaks and indentation to such files when loading them using a syntax coloring scheme that is designed for that purpose. If you want this, select a scheme from the “syntax coloring scheme for adding line breaks to files that don’t have any” drop-down list.

The line breaks and indentation are added to the file while it is loaded. The file on disk is not modified while loading. But if you save a file to which EditPad Pro automatically added line breaks and indentation then those line breaks and indentation are saved into the file.

For some file formats, such as XML, EditPad Pro has an extra scheme marked (breaking). The (breaking) scheme supports the minimal amount of syntax to correctly add line breaks and indentation. This ensures no time is wasted while loading the file. The scheme needs to process the whole file before you can access the end of the file. Because the (breaking) scheme does not handle the full syntax, you should only use it for adding line breaks. Though EditPad does allow you to select it for syntax coloring, you’ll likely find it does not apply enough detail. The XML (breaking) scheme, for example, highlights XML tags including all their attributes in a single color. The other XML schemes apply different colors to attributes and attribute values.

RGB Color Preview

Some syntax coloring schemes can show text with actual colors specified in the file. If the scheme you selected does then you can check “RGB color preview” to enable this. The HTML and CSS schemes included with EditPad, for example, use this to show CSS colors as their actual colors. CSS colors are then highlighted using the actual RGB colors specified by the CSS color with the text color automatically chosen by EditPad to sufficiently contrast with the highlight color to remain readable. If you turn off “RGB color preview” then the HTML and CSS schemes highlight CSS colors with the “markup attribute value” color just like any other attribute.

Live Spell Checking

EditPad Pro can apply live spell checking. The “live syntax-aware spell checking” determines the default state of the Extra|Live Spelling menu item. Read the help topic on that menu item to learn how live spelling works together with syntax coloring in EditPad Pro.

The spell checker only works if you have previously downloaded and installed one or more Just Great Software spell checker dictionaries. Click the Download Spell Checker Dictionaries button to download some or all of the spell checker 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 containing 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 you 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.