Text Clips are text fragments that are easily inserted into your code. Programmer's Notepad comes with a variety of text clips to help you when working with common programming languages.
Clips can be inserted either from the clip browser (View | Windows | Text Clips on the menu, or Alt-F7) or by typing a clip shortcut into the editor and pressing Tab. The clip browser can also be used to add, edit and remove clips, and you can group clips to make them easier to find in the browser. If you're not sure of the shortcut for a clip you're trying to insert, press Ctrl-Alt-Space or select Insert Text Clip from the Edit menu and you will see a completion list of currently active Clips.
When editing PN will only complete Clips that are mapped to the Scheme for the file you are currently editing. To use clips from another Scheme/language use the browser to select the clip you're looking for.
Text Clips can contain more than simple text, they can include placeholders and variables which help to insert the text you want quickly.
You can see a short video of early text clips functionality in use here:
http://video.google.com/videoplay?docid=-8777247135013651124&hl=en
At this time it was necessary to use a shortcut to insert all clips, you can now press tab to insert a matching clip name.
Placeholders allow you to jump through interesting points in the clip after inserting it, and also allow you to copy text into multiple places in the Clip.
For example, the following clip will let you type text into two points before leaving the cursor at the end:
if (${1})
{
${2}
}${0}
When you first insert this clip, the cursor will be placed on placeholder 1. You can fill text in here, and then press Tab to move to placeholder 2. A final Tab will move the cursor to special placeholder 0. You can specify default text for your placeholders, allowing easy insertion of common text while allowing you to change the value at clip insertion time. For example, the following C# clip defaults to generating a public method with no return value and an empty parameter list:
${1:public} ${2:MethodName}(${3})
{
$0
}
If you repeat a placeholder number, then the text you enter for that first placeholder will be duplicated into all following ones:
for(${1:i} = ${2:0}; ${1} < ${3:count}; ${1}++)
{
$0
}
Variables allow you to insert information from the editor (Text Clip Variables) or system environment into the text you generate:
/**
* @file ${PN_FILENAME}
* /
When you're not sure that a variable will have a value, you can include an optional default:
Selection: ${PN_CURRENTWORD:(none)}
The Text Clips that Programmer's Notepad comes with are stored in the Programmer's Notepad\Clips directory in sub-directories named for each Scheme. One .clips file can contain a number of text clips. When you modify or add clips of your own these are stored in the User Settings directory. See Settings Storage for how to find these.