Custom collections

You can add your own collections to CodeGofer. First you need to create one and compile it to CGX file (see format description below). Next, you need to import newly created file to CodeGofer via "Collections" tab of preferences dialog:

CGX format description (v1.0)

CGX is an XML-based file format for representing custom snippet collections

Elements descripton

CGX file should consist of one top-level collectionelement. It may have following attributes:

  • ident – unique collection identifier. "Reverse domain" notation recommended but not enforced. e.g.: ""
  • name – human-readable name of the collection. e.g.: "Cobol Cookbook"
  • version – collecion version in maj.minor format. e.g.: "1.0"
  • syntax – name of syntax highlighting. Currently unused.

collection element contains one description elements and zero or more snippet elements.

description element contains human-readable description of the collection. It's not visible to the user at the moment but it may change in the future

snippet should have mandatory attrubute name. Human-readable name of the snippet presented to user in search results. Also should contain mandatory code element with actual snippet code and may contain two optional elements:

  • description – human-readable description of the snippet's purpose
  • tags – coma-separated list of tags

Indexer uses snippet description combined with tags and name to match search query with the snippet



<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<collection version="1.0" name="Custom collection sample" ident="com.bluezbox.codegofer.custom.sample" syntax="objc">
    <description>Custom collection example</description>
    <snippet name="Demo Snippet">
        <description>Just sample snippet</description>
        <code>#import &lt;Cocoa/Cocoa.h&gt;
@implementation SampleObject
- (id) init {
    self = [super init];
    if (self) {
        // TODO: initialize
    return self;