Context Files

Context files contain information used for 2 important PSPad features; Show Clips (Ctrl+Space) and Auto Completion (Ctrl+J).

Context files are stored in the /Context sub-directory of you main PSPad folder with a .DEF file extension. The format of these files is described below

 

Context File Format

The context file has 3 main sections; clip definitions, clip macro definitions, and keywords used for auto-completion.

Clips are templates or pieces of boilerplate code that can be placed at the cursor position in your file. Some of these clips can operate on selected text in a file (See Clips).

The clip macro definitions referred to here are used in 'interactive clip' definitions. These interactive clips make it possible to have blocks of code generated from templates but unlike standard clips, the user can supply values to influence the output (See Interactive Clips).

Auto-completion is a mechanism designed to speed code entry. Auto-completion, when called, will display a popup list of words matching that which you have entered. This list will be made up initially from words listed in the [Keywords] section of the .DEF file. The system will also include words from the file you are working on so that, as you type, things like variable names, etc are added to the list.

There are a number of context files supplied with PSPad. They have the same name as the highlighters they are used with. Some of the context files supplied include:

  • SP.def
  • Bat.def (MS-Dos batch files)
  • CPP.def (C++)
  • CSS.def (Cascaded style sheets)
  • FoxPro.def
  • HTML.def
  • Java.def
  • JavaScript.def (JavaScript)
  • Pascal.def
  • Perl.def
  • PHP.def
  • VBScript.def (Visual Basic script)
  • XML.def