Table of Contents
• Building CodeLite - Linux
The SnipWiz Plugin
The SnipWiz plugin was generously contributed by Frank Lichtner. It has two parts: a Snippet Wizard and a Template Class Wizard.
This provides a way of inserting commonly-used code snippets direct into your code. Several are provided by default, but you can amend these and add others of your choice. You can insert a snippet into your code by right-clicking and choosing SnipWiz from the context menu.
There are two Placeholder symbols available:
For example, one snippet is:
for ($ = 0; $ < @; $++)
Let's say you had selected the word 'counter' This will expand to
for (counter = 0; counter < |; counter++)
where the '|' symbol represents the caret position (imagine it blinking), in the right place for you to add the maximum-count figure.
The Edit Snippets dialog is accessed from Plugins > SnipWiz > Settings. On its left is a list of menu entries for known snippets. On the right the selected entry is displayed, with the code it inserts. The Change and Remove buttons do the obvious things to the current selection. To add a new item, amend the selection (both the menu item and the code), then click Add.
For example, to add a snippet that surrounds a string with wxT(" and "), amend one of the similar ones.
If you press the Ctrl key while clicking on the snippet menu, the snippet is not inserted at the current caret position, but instead is copied to the clipboard and also to an internal buffer. You can do the insertion elsewhere, perhaps repeatly, by pasting in the usual way (e.g. Ctrl-V), or from that buffer (via the context menu).
If you have a multi-line snippet, you should paste from the internal buffer, since this will retain the correct indentation.
Template Class Wizard
Plugins > SnipWiz > Template class runs the Template Class dialog. This lets you create templates of classes to reuse. For example, I often derive from wxDialogs; here's a template that expedites this.
The Header File Template
The Implementation File Template
When you've finished, click Add to save the template.
Using the Template
The Generated .cpp File