Searching
You can find your saved code easily with the Pieces for Sublime Text Plugin by utilizing a few different search methods.
Finding Saved Snippets
One of the most powerful tools baked into the Pieces for Sublime Text Plugin is the search functionality which allows you to utilize three different searching methods.
To get started:
-
Open the command palette using
⌘+shift+p
(macOS) orctrl+shift+p
(Windows/Linux) -
Type
Pieces: Search
via Fuzzy Search
Fuzzy Search helps find relevant matches even with typos, misspellings, or variations.
It’s great for locating partially-remembered function names, error messages, log entries, or comments, saving time with flexible, quick searches.
via Full Text Search
Full Text Search finds documents or records with an exact word match.
It indexes all words for fast searching, ideal for specific queries like function declarations, pulling up matching snippets and related classes efficiently.
via Neural Code Search
Neural Code Search uses machine learning to find code snippets based on natural language descriptions.
It captures context and semantics, delivering accurate results, especially helpful for new developers or complex queries.
Viewing and Reusing Saved Snippets
Saved snippets can be viewed alongside their saved metadata by opening up them up directly from the command palette.
via Command Palette
-
Open the Command Palette using
⌘+shift+p
(macOS) orctrl+shift+p
(Windows/Linux) -
Type in
Pieces: Open Saved Material
to access your saved materials -
Scroll through the list to find the snippet you’d like to view
-
Highlight the desired snippet and press
return
(macOS) orenter
(Windows/Linux)
This opens up the snippet in markdown preview mode in a separate window. In the new window, you have the ability to share, view metadata, edit, copy, or delete the snippet.
Real Time Snippet Streaming
Each product in the Pieces Suite uses PiecesOS to get information about your snippets' context.
When you update a snippet in the Pieces for Developers Desktop App—such as a name or description, tags or any of the other metadata—those changes are also reflected in your Pieces for Sublime Text Plugin without refreshing.
If your snippets are not updating right away, see the troubleshooting guide for details on how to refresh your snippet list.