Syntax Highlighter Preferences

The appearance of syntax highlighted source files can be customised using this tab of the Preferences dialogue box. The tab is accessed by selecting the Tools | Preferences menu item then clicking the Syntax Highlighter tab.

Note

Syntax highlighter customisation applies to the Detail Pane, exported files and source code copied to the clipboard. Highlighting used in printed documents is configured from the Printing tab.

Different syntax highlighter styles can be saved and given identifying names for later user.

Highlighter Font

The font used by the highlighter can be changed. Choose one of the available fixed-pitch fonts from the Font name drop down list and specify the font size using the Font size combo box.

Note: The highlighter font is ignored in code previews in other tabs in the Preferences dialogue box to ensure that previews fit the available space.

Syntactic Elements

The colour and font style used for various syntactic elements of the source code can be changed. Select an element in the Elements list box then using the Font style check boxes and Colour drop down list. A preview of the element is displayed.

Named Styles

CodeSnip provides five pre-defined styles that are applied by clicking the Use Predefined Style button and selecting the style from the drop-down menu that appears.

The styles are:

  1. CodeSnip Classic – style of highlighting used in main display of CodeSnip v2 and earlier.
  2. Delphi 7 – default highlighting style used in Delphi 7.
  3. RAD Studio – default highlighting style used in Borland / CodeGear / Embarcadero RAD Studio.
  4. Visual Studio™ – default highlighting style used by Microsoft Visual Studio.
  5. User Defined Styles – displays the User Defined Highlighters dialogue box where any custom styles saved by the user can be selected. Saved highlighters can also be deleted from this dialogue box.
  6. No Highlighter – no syntax highlighting used. You might want to use this style if you are storing code other than Pascal in CodeSnip.

Reseting the Highlighter

The highlighter font and all the element styles can be reset to their default appearance by pressing the Restore Defaults button. The default is the RAD Studio style.

Saving Custom Highlighters

If you want to regularly switch highlighter styles, for example for printing, and don't want to confine yourself to the pre-defined styles, CodeSnip lets you save the current style.

To do this click the Save Style button to display the Save Highlighter dialogue box where you can choose a name for the style.

Saved styles can be restored (or deleted) by clicking the Use Named Style button and selecting the User Defined Styles option (see above).

Any number of custom highlighter style can be saved.