1. Essentials

1.1. Organizing snippets with folders

SnippetsLab keeps your snippets organized by storing them in folders. When you select a folder from the sidebar, all snippets under that folder or any subfolders are listed in the main view. If a snippet does not belong to any folder, it will appear under “Uncategorized.”

  • To show or hide the sidebar: Choose View > Show Sidebar from the menubar, or press Shift-Command-L.

  • To create a folder, do any of the following:

    • Choose Library > New Folder from the menubar.

    • Click the plus button in the bottom left of the sidebar, then choose New Folder.

    • Press Shift-Command-N.

  • To place a folder inside another folder, do any of the following:

    • Drag the folder and drop it on top of the other folder.

    • Hold Option when creating a new folder to create a nested folder directly.

  • To rename or delete a folder:

    • Right-click a folder from the sidebar, then choose Rename or Delete.

    • Deleting a folder will also delete all subfolders and move affected snippets to “Uncategorized.”

  • To automatically sort folders and Smart Groups: In Settings > General, select Automatically sort folders and Smart Groups.

  • To set the default language for a folder: See Default language.

  • To show or hide snippets from subfolders: Right-click on the snippets list view, and check or uncheck Display Options > Include Snippets From Subfolders.

  • To set a custom folder icon: Right-click on a folder, and choose Customize Icon…

Tip

You can drag one (or multiple) snippets directly to a folder to add them to said folder. This works for tags as well.

1.2. Adding and managing tags

You can add tags to your snippets to make them easier to find. Unlike folders, a snippet can have multiple tags at the same time.

  • To show the tags field: Click ellipsis.circle button and choose Add Tags.

    shadow

    If you use tags frequently, you may want to make the tags field always visible. To to that, from Settings > General, select Always show tags field.

  • To rename or delete a tag: Right-click on a tag from the sidebar, and select Rename or Delete.

    Deleting a tag will remove it from all snippets.

Note

Tag names are case-insensitive, yet case-preserving. This means you can use any capitalization when searching for or adding existing tags, but they will always be displayed exactly as they were created. For example, after creating a tag named LaTeX, you can equivalently add or search for latex later.

1.3. Smart groups

Smart groups are a powerful feature of SnippetsLab that allows you to dynamically search your snippets based on custom predicates. This means that you can create smart groups to display subsets of your snippets that meet specific criteria, such as:

  • All snippets without any tags

  • All snippets with multiple fragments

  • All snippets in the Apple Development folder plus any that have either the iOS or Mac tag

  • All snippets that are modified within the last 7 days

Smart groups can be especially useful for organizing and managing large libraries of snippets. To create a smart group, follow these steps:

  1. Choose Library > New Smart Group from the menubar, or press Control-Command-N.

  2. Enter a name for your smart group.

  3. Specify the rules you want to apply.

  4. To add another set of rules within a rule, hold down the Option key and click the Nest button.

  5. If you want to create more complex rules—for example, with some criteria matching all rules and others matching any—you can create sets of “nested” rules.

shadow

You can also rename, modify, duplicate, or delete smart groups by right-clicking on them and choosing the corresponding item in the context menu. You can also set a custom icon for any smart group by choosing Customize Icon… from the context menu.

Example smart groups

Here are a few examples of smart groups that you might find useful:

  • Recently modified: Display all snippets that have been modified within the last 7 days.

  • Untagged: Display all snippets that do not have any tags.

  • Attachments: Display all snippets that have attachments.

  • By language: Display all snippets in a specific language.

  • By project: Display all snippets that belong to a specific project (e.g. filtered by specific folders and/or tags).

Smart groups are a powerful and flexible tool that can help you to better organize and manage your snippets. Experiment with different smart groups to see how they can help you to be more productive.

1.4. Shortcuts

You can add your most frequently used folders, tags, and smart groups to the Favorites section of the sidebar as a shortcuts. This can help you to quickly access the items that you use most often.

shadow
  • To add a shortcut, do any of the following:

    • Right-click on a folder, tag, or smart group and choose Add to Favorites.

    • Drag a folder, tag, or smart group to the Favorites section.

  • To remove a shortcut: Right-click on a shortcut and choose Remove from Favorites.

    Removing a shortcut won’t affect the underlying folder, tag, or smart group.

1.5. Languages

1.5.1. Active languages

SnippetsLab supports over 530 languages and text formats. To prevent the language menu from becoming overwhelmingly long, the app only shows active languages, as selected by the user. By default, the list of active languages only contains a handful of the most commonly used ones. You should customize this list to include the languages you personally use.

To set the active languages, open Settings > Languages. Select the checkbox next to a language to mark it as active. To find a language quickly, use the search field directly above the list. You can also click the Active button on the left to see only active languages.

shadow

Note

Unchecking a language as active will only hide it from the language menu. It won’t affect any snippets using this language.

1.5.2. Default language

You can select both an app-wide default language and a default for each folder. Newly created snippets will use the folders default language (if set), and fallback to the app-wide default.

  • To set an app-wide default language: Choose an item in Settings > General > Default Language.

  • To set a per-folder default language: Right-click on a folder and select an option in the Default Language submenu.

Note that in both cases, only Active languages are displayed in the menu.

1.5.3. Automatic language detection

SnippetsLab automatically detects and sets the language when you paste content into the editor. This feature is powered by machine learning and supports over 50 most commonly used languages.

By default, the app only detects language if there isn’t a default language set for the current folder. You can choose to always detect, or to disable it entirely, from Settings > Languages.

1.6. Snippets and fragments

A snippet can contain multiple fragments, which are individual parts of the snippet. Each fragment can have its own notes and language.

Fragments can be useful when a snippet logically consists of multiple parts, especially when they have different languages. Some common use cases include:

  • A class header and its implementation

  • Some HTML code and its JavaScript/CSS counterparts

  • Different solutions to one problem

_images/ff.png
  • To pin a snippet to the top: Swipe right to reveal the Pin action, or right-click and choose Pin from the context menu.

  • To create a new fragment: Click on the ellipsis.circle button and choose New Fragment, or press Command-T.

  • To rename or delete a fragment: Right-click on the fragment tab and choose the corresponding option.

  • To reorder fragments: Right-click on the fragment tab and choose Move to Right or Move to Left. Alternatively, use the keyboard shortcuts Option-Shift-Command-[ and Option-Shift-Command-].

Tip

You can use the Command-1~9 keys to quickly jump to a specific fragment.

1.8. Custom notes

You can add notes for a fragment to a dedicated notes area. Notes are a great way to add additional contexts and references that you do not want to copy otherwise.

By default, the notes area is hidden if there are no notes for the current fragment. To add notes, click the ellipsis.circle button and choose Add Notes.

shadow

If you use notes frequently, you may want to set the notes area to always be present. To do so, from Settings > General, select Always show notes field.

1.9. Attachments

SnippetsLab allows you to add attachments to snippets. This can be useful for storing related files, such as screenshots, sample data, or configuration files. There is no limit to what files can be attached, as long as the individual files are below the limit of 100 MB.

To insert an attachment, do any of the following:

  • Click on the ellipsis.circle button and choose Add Attachments….

  • Drag and drop a file into the snippet area.

  • Paste images and files directly into the editor.

shadow

1.9.1. Preview and manage attachments

To view an attached file, double-click the attachment or press the spacebar while selected. This will activate Quick Look, which allows you to preview the file without opening it. Note that Quick Look may not be available for all file types. Any Quick Look plugin installed on the system will also be used.

You can also perform other actions on the attachment from the context menu, such as opening, renaming, deleting, or saving a copy.

1.9.3. Optimize image attachments

When inserting images, you can allow SnippetsLab to automatically optimize the files. This optimization can often reduce the image file size considerably with only minimal impact on the perceived quality. You can toggle this option at Settings > General > Save optimized copies when importing images.

Tip

You can create a smart group to show all snippets with attachments.

1.10. Searching

SnippetsLab offers powerful searching capabilities. You can search from both the main application and the menu bar assistant. To switch key focus to the search bar from anywhere in the app, use the keyboard shortcut Shift-Command-F.

1.10.1. Search options

SnippetsLab allows you to toggle a number of search features, such as full-text search, fuzzy search, result ranking, and case sensitivity. To change these settings, click the magnifyingglass button to reveal the options menu.

1.10.2. Search filters

By default, SnippetsLab will display all snippets that match the query, regardless of language, folder, or tag. However, you can use search filters to specify exactly what you want to find. For example, you can find snippets with a specific language, in a specific folder, or with specific tags.

shadow

There are four ways to bring up the search filters menu:

  • Type the keyword in: in the search bar.

  • Click on the magnifyingglass button and choose Insert Filter.

  • Use the keyboard shortcut Control-Option-Command-P.

  • Use the global shortcut for autocompletion: Option-Esc.

While the menu is open, you can continue typing to narrow down the choices. You can also combine multiple filters to show only snippets that satisfy all the criteria.

To quickly select what you want, use the Command-Up/Down keys to jump to the top or bottom of the list, and Option-Up/Down keys to jump to the previous or next section.

Tip

By default, the search filters menu will close automatically when you make a selection. To keep it open, hold the Option key.