Pieces for Developers | Sublime Plugin
Please make sure you have Pieces OS installed to run the Package.
Welcome to the Pieces Sublime Plugin!
The Pieces Sublime plugin is your gateway to managing your saved code snippets in Pieces directly inside Sublime Text. Seamlessly interact with Pieces OS and enhance your productivity with code snippet management, in-window generative AI conversations, intelligent snippet searching, and AI debugging and code commenting.
Before diving in, let's ensure everything is set up to your liking. You can customize the LLM model or the host by navigating to:
Preferences > Package Settings > Pieces > Settings
.
You can also open the settings from the command palette Pieces: Open Settings
.
Currently, the Pieces for Sublime Plugin supports 16 AI models, so you can choose the one that best fits your needs.
- GPT-4o
- GPT-4
- CodeLlama GPU
- GPT-3.5-turbo
- Phi-2 CPU
- GPT-4 Preview
- Codey (PaLM2)
- Llama2 GPU
- (Gemini)
- GPT-3.5-turbo-16k
- Phi-2 GPU
- Mixtral GPU
- NeuralHermes-2.5-Mistral-7B CPU
- NeuralHermes-2.5-Mistral-7B GPU
- (PaLM2)
- Llama2
Using the command Pieces: Connect Personal Cloud
or Pieces: Disconnect Personal Cloud
from your command palette logs you in and out of your Pieces account. An output panel is available to check your cloud status and login status.
Logging into your Pieces account lets you sync your snippets and settings between Pieces OS and other Pieces plugins.
Saving a new snippet in Pieces is a breeze! Just select the code you want to save, right-click to open the context menu, and choose Pieces > Save to Pieces
. Your code is now safely stored!
You can ask the Pieces Copilot questions about your code, view your conversations list, or start a new conversation by opening the command palette and entering Pieces: Copilot
. Your selected LLM will then output an answer as a generation on the right side of your screen, right in your Sublime Text editor window.
Need some help from the Pieces Copilot? Just select the code and right-click to open the context menu and choose Pieces > Ask Copilot
.
You can utilize the LLM capabilities of Pieces Copilot with an intelligent debugging feature, helping you identify errors in your code and preview potential solutions before applying changes.
The mark of well-written, high-quality code (aside from functionality!) is code comments. This can get tedious, though, so the Pieces for Sublime Plugin comes with a built-in intelligent commenting feature. Selecting the Add code comments
option from the context menu will add comments to your selected portion of code.
Let Copilot do the heavy lifting for you!
The Pieces for Sublime Plugin lets you ask context-focused questions based on the file you're working in, or the entire project itself. This is an extremely useful feature for new developers getting to know an unfamiliar codebase just as well as experienced developers looking to cut down on production time.
- Ask About the Current Project: Use the command
Pieces: Ask about the current project
to ask the Pieces Copilot a question about your entire project. - Ask About the Current File: Use the command
Pieces: Ask about the current file
to get assistance with the current opened file.
You can import and export code snippets you've saved using other Pieces software for use in or from Sublime.
- Import Sublime Snippet: Use the command
Pieces: Import Sublime Snippet
to import a Sublime snippet into Pieces. - Export Pieces Material: Use the command
Pieces: Export Pieces Material
to export a Pieces snippet back to Sublime.
Ready to access your saved materials? It's super easy! Just follow these steps:
- Open your command palette (
Ctrl+Shift+P
orCmd+Shift+P
). - Run the command:
Pieces: Open Saved Material
. - Select the asset you wish to open from the list.
Your material is now open and ready for you to use.
You can search for saved snippets using Pieces: Search
.
There are three types of searching:
-
Fuzzy Search: Fuzzy Search finds snippets that are likely to be relevant, even if they are not exact matches. It is particularly useful for handling typos, misspellings, and variations in data.
-
Full-Text Search: Full-Text Search is a technique used to search for documents or records that contain the exact sequence of words in the search query. It indexes all the words in a document to enable fast and efficient searching.
-
Neural Code Search: Neural Code Search leverages neural networks and machine learning to improve the search and retrieval of code snippets. It allows you to use natural language to describe what you are looking for, capturing the semantics and context of the code to provide more accurate and relevant results.
Want to make changes to your saved materials?
Switch to editor mode by clicking the Edit button on your saved snippet. Modify the content as needed and save your changes with a simple command/ctrl + s
.
If you want to share a saved snippet with another developer (even if they don't have a Pieces account), you can.
Just select the code, right-click to open the context menu, and choose Pieces > Generate shareable link
.
You can also share a saved snippet by opening it with Pieces: Open saved Material
and clicking the Share button.
Enhance your coding speed with auto-completion using saved Pieces Snippets. When you have Pieces Snippets saved, you will receive automatic code completions tailored to specific programming languages.
You can enable or disable this feature in your settings by entering Pieces: Open Pieces Settings
in your command palette. Then, overwrite the snippet.autocomplete
object to false
to turn the auto-completion feature off.
If you're experiencing an issue or something isn't working properly, try reloading the plugin using the command Pieces: Reload Plugin
in your command palette.
Don't forget to make sure Pieces OS is running.
Experiencing an issue or have feedback for the Pieces team?
No worries, we've got you covered.
Simply open the command palette and run Pieces: Get Support
. From here, you will find resources where you can connect with the Pieces team.
Join our Discord Community
Become a part of our Discord community to stay updated and engage in discussions about our features.
Have an idea for a new feature? Feel free to submit your suggestions on our GitHub page.
Stay connected and up-to-date with our latest blogs.
Explore our collection of awesome Pieces plugins.
Don't forget to check out our YouTube channel for Power Tips & Best Practices
We take your privacy seriously. We are committed to ensuring that your data remains private and secure. To that end, we want to make it clear that:
We do not collect any client-side telemetry.