Feature Showcases

Snippets are frequently used strings that can be quickly inserted into the current document. For example, repetitive sections of code or standard comments can be stored within a snippet. Snippets have advanced properties; they support the use of Tabstops and Interpolation Shortcuts, can be assigned to Key Bindings, and allow for the specification of indentation context and cursor position.

Snippets are stored in the Projects sidebar or the Toolbox.

Creating Snippets

To create a code snippet, select the desired block of text in the Editor Pane. Then drag and drop the selected section onto the Toolbox tab or into a project on the Projects tab.

Alternatively, select the desired text, then right-click and select Add as Snippet in the Toolbox.

Alternatively, right-click a folder in the Toolbox or on a project or folder name in the Projects sidebar, and select New Snippet. If you use this method, you must manually enter the contents of the snippet; text selected in the Editor Pane is not automatically added to the Snippet dialog box.

Configuring Snippets

To configure snippet properties, right-click the snippet on either the Toolbox tab or the Projects tab, and select Properties. The following configuration properties are available:

Using Snippets

To insert the contents of a snippet at the current cursor position in the Editor Pane, double-click it, or right-click the snippet and select Insert Snippet.

Although you can also drag and drop snippets onto the Editor Pane, the cursor position and indentation check box options explained above in Configuring Snippets will only take effect if the snippet is added using the double-click or Insert Snippet method.


Snippets saved in a toolbox or project folder called "Abbreviations" (or a language-specific sub-directory) can be inserted by typing the snippet name in the buffer. See Abbreviations.

Snippet Options

To access options for the selected snippet, right-click a snippet in the Toolbox and select the desired option.

The following options are available:

Snippet Properties

Snippet properties are used to alter or rename snippets (as described in Configuring Snippets, above). The Properties dialog box is also used to assign a custom icon to a snippet or to assign a custom key binding. To access the Properties dialog box, right-click the snippet and select Properties.

Assigning Custom Icons to Snippets

The default snippet icons can be replaced with custom icons. Komodo includes more than 600 icons; alternatively, select a custom image stored on a local or network drive (use 16x16-pixel images for best results).

To assign a custom icon to a snippet:

  1. In the Projects or Toolbox sidebar, right-click the desired snippet and select Properties. Alternatively, click the icon in the Projects or Toolbox sidebar, then select Projects|snippet_name|Properties or Toolboxsnippet_name|Properties.
  2. In the Properties dialog box, click Change Icon.
  3. In the Pick an Icon dialog box, select a new icon and click OK. Alternatively, click Choose Other, and browse to the desired image file.
  4. In the Properties dialog box for the snippet, click OK. The custom icon is displayed next to the snippet.

To revert to the default icon for a selected snippet:

  1. In the Projects or Toolbox sidebar, right-click the desired snippet and select Properties.
  2. Click Reset, then click OK. The default icon is displayed next to the snippet.

Snippet Key Bindings

To assign a key binding to a snippet, right-click the snippet on either the Toolbox, and select Properties. Select the Key Bindings tab, and configure the desired binding. See Key Bindings for Custom Components for more information.

See Abbreviations for details on inserting snippets by name.