SnippetsLab keeps your snippets organized by storing them in folders. When you choose a folder from the sidebar, all snippets under that folder are listed in the middle column. If a snippet does not belong to any folders, it will appear under “Uncategorized.”
- Show or hide the sidebar: Choose View > Show Sidebar from the menubar, or press
- Create a folder: Do any of the following:
- Place a folder inside another folder: Drag the folder on top of the other folder.
- Rename or delete a folder: Right-click a folder from the sidebar, then choose Rename or Delete.
- Move snippets to a folder: Drag one or more snippets to the folder you want to move to. To select multiple snippets,
Command-clickthem. To select a range of snippets,
- Automatically sort folders and Smart Groups: By default, you can manually reorder the folders with drag and drop. To keep them sorted alphabetically, choose SnippetsLab > Preferences…, click General, then select Automatically sort folders and Smart Groups.
- Set default language: You can set the default language for a folder. For details, please see Default Language.
SnippetsLab can create “Smart Groups” based on rules you speficy, and then update these groups automatically as your library changes. Smart Groups are listed in the a special section of the sidebar, with icon next to it.
Smart Groups can be useful because it allows you to dynamically search your snippets based on a wide range of criteria. For example, you could create a Smart Group that:
- Display all snippets without any tags
- Display all snippets with either
- Display all snippets with
If you want to create more complex rules — for example, with some criteria matching all rules and others maching any — you can create sets of rules, or “nested” rules.
To create a Smart Group, follow the steps below:
- Choose File > New Smart Group from the menubar, or press
- Enter a name for your Smart Group.
- Specify the rules you want to apply.
- To add another set of rules within a rule, hold down the
Optionkey and click the Nest button. (When you hold down the
Optionkey, the Add button changes to the Nest button.)
To rename, modify, duplicate or delete a Smart Group, right click on it and choose the corresponding item in the contextual menu.
You can add your most frequently used folders and Smart Groups to the “Favorites” section of the sidebar as a shortcut.
- Add a shortcut: Shortcuts can be added by:
- Right-click on a folder or Smart Group and choose Add to Favorites.
- or drag a folder or Smart Group to the Favorites section.
- Remove a shortcut: Right-click on a shortcut and choose Remove from Favorites. This operation only removes the shortcut and won’t affect the underlying snippets, folder or Smart Group.
SnippetsLab offers more than 350 different languages and language varients. To prevent the language selector menu from becoming too long, SnippetsLab only displays the “active” languages. By default, the list of active languages only contains
To set the active languages, choose SnippetsLab > Preferences… from the menubar and click Languages. Select the checkbox next to a language to mark it as active. To find needed languages quickly, you can use the search field above the list. You can also click the Active button to see only active languages (click All button to see all available languages.)
Mark a language as inactive will only hide it from the language selector menu, and won’t affect the snippets using this language.
You can select a default language for each folder, and snippets created in the folder will automatically use that language. The default value is “Plain Text.”
To change the default language, right-click on a folder and select one language in the Default Language submenu. Only Active Languages are displayed in that menu.
Snippets and Fragments¶
You can include multiple different “part” to a single snippet, which is known as a Fragment. Different Fragments under the same snippet can have different notes and languages.
Fragments can be useful when a snippet logically consists of multiple parts, especially when they have different languages. For example:
- A class header and its implementation
- Different solutions to one problem
- Add a new fragment: Either click the button and choose New Fragment, or press
- Rename a fragment: Right-click the fragment and choose Rename.
- Delete a fragment: Right-click the fragment and choose Delete, or swipe left and choose Delete (OS X 10.11+).
- Reorder fragments: Right-click the fragment and choose Move to Right or Move to Left.
- Open in new window: Right-click the fragment and choose Open In New Window.
You can add notes for a fragment to a dedicated “Notes” area. Links in the notes will automatically be recognized and made clickable.
If you use notes frequently, you may want to set the notes field to always be displayed. To do that, choose SnippetsLab > Preference from the menubar, click General, then select Always show notes field.
SnippetsLab offers powerful search capabilities to promote your productivity. You can initiate a search from both the main application and the menubar assistant. To begin searching, simply type your keyword in the search bar.
SnippetsLab provides two search scopes:
- Only Search Title: A snippet will be included in the search result only if its title case-insensitively contains the search keyword.
- Search Title and Content: A snippet will be included in the search result if its title, any fragment’s title, note or content case-insensitively contains the search keyword.
Filter Search Results¶
By default, SnippetsLab will display all snippets that contain the keyword, no matter which language, folder or tag they may have. However, you can filter and customize your search results to quickly find exactly what you want. For example, you can find snippets with a specific language, in a specific folder or with some specific tags.
There are three types of filters: folder, tag and language.
- Add filters: Type
in:in the search field to bring up the filters selector. Continue typing to narrow down the choices.
- Use multiple filters: You can also combine multiple filters at the same time, e.g., only display snippets in “Frontend Dev” folder with “CSS” language. When multiple filters are present, only snippets that satisfy all the filters will be included in the search result.