Various applications exist for helping programmers maintain a list of commonly used code samples – some are stand alone, others integrated into popular software such as Coda. Today I will be exploring Snippet – a great looking Mac application that allows you to store notes and snippets of code and search through them quickly.
Snippet covers all the basics, coupled with a range of advanced functionality: searching, syncing, and a remarkably pleasant user interface. This review will walk you through how to add and search snippets, explain the drawbacks, and offer a few more details about our forthcoming competition to win a copy.
The ability to quickly and easily add a new piece of code is vital, and Snippet certainly delivers. Hitting a shortcut key (Ctrl+S by default) will bring up the interface for adding a new code fragment:
From here you can select the programming language in question, and copy-and-paste the code to be stored (or drag-and-drop a file). Code highlighting is used to great effect, and looks good against the black background.
You can also enter text directly, though I noticed a problem whereby the up and down keyboard arrows do not work for moving between lines – a niggle that becomes fairly annoying after a while. Hopefully this will be fixed in a future version.
Tagging is fully supported throughout Snippet, with adding tags simply a case of typing a comma separated list after the snippet content. Quick and effective:
To quickly create a snippet containing a selected block of code, use the keyboard command “Command-Shift-6”. This will automatically copy the selected text into a new snippet, ready to be stored.
After a decent library of snippets has been built up, you need to be able to rely on a solid search engine for finding all the information stored. Snippet seems to work well in this area with accurate search results being produced very quickly. Both tags and the body of the code are searched.
Snippet can work without requiring the mouse at all. Ctrl+S will bring up the search field, you can search with the keyboard, then hit Command+[result number] to copy that particular snippet to your clipboard. Focus is then automatically returned to the previously application.
Preferences and Syncing
A few preferences exist for customizing how the application works. You can specify whether Snippet should launch at login, and adjust the shortcut key for quickly switching to the utility. If you would prefer that Snippet automatically pastes code into the active window (rather than simply copying it) this can be specified here.
Another notable feature is the ability to synchronize Snippet with MobileMe to maintain the same code library on several different computers. This can be a real time-saver and it’s great to see MobileMe being put to full use by developers.
A few other applications exist for managing a collection of code samples. Here are a few to consider:
- CodeCollectorPro – A fairly powerful application, also with keyboard shortcuts to keep the process mouse-free. Slightly more expensive, at just under $30.
- Snippely – A free Adobe Air application. You can’t argue with the price, but the interface is very simple and code highlighting isn’t quite as well executed.
- Schnippselchen Pro – An incredibly unusual name, but the app is completely free and worth taking a look at. Seems very easy to use.
Snippet is an incredibly handy tool for anyone who needs to use the same piece of code or text on a regular basis. It costs $12.95 – fairly reasonable when you consider the time it could save.
If Snippet appeals to you, be sure to check back next week when we’ll be running a competition to win one of ten licenses!