Skip to main content

Pieces for Developers Sublime Text Plugin

Get the Sublime PluginGet the Sublime Plugin

The Pieces Sublime plugin is your gateway to managing your saved materials in Pieces directly from within Sublime Text. Seamlessly interact with Pieces OS and enhance your workflow like never before.

Getting Started​

Installation​

info

In order to use the Pieces Sublime Plugin, you must have Pieces OS. We also recommend downloading the Pieces for Developers Desktop App.

  • Download the package control
  • Open your command palette. You can use the shortcut key combination Ctrl+Shift+P on Windows and Cmd+Shift+P on macOS.
  • Search for Package Control: Install Package
  • Search for Pieces and select it.
tip

When you first download the package, it will download and install some required dependencies. As a result, you may need to restart Sublime for Pieces to load in.

Pre-releases​

You can download and checkout some new beta features before releasing.

  • Make sure you have downloaded the package control
  • Download the Pieces.sublime-package from releases on GitHub
  • Add Pieces.sublime-package to the Installed Packages directory.
    • Windows: %APPDATA%\Sublime Text\Installed Packages
    • MacOS: ~/Library/Application Support/Sublime Text 3/Installed Packages
    • Linux: ~/.config/sublime-text/Installed Packages
  • Open Sublime and enjoy the package

Initial Setup​

info

While connecting to your personal cloud provides additional features like generating shareable links, backing up your data, and more, it is not required to use Pieces. You can enjoy the core functionalities anonymously without an account.

Login/Logout​

You can log in and out of your Pieces account using the Pieces: Login or Pieces: Logout command in your command palette.

Login/Logout in Sublime

Connect or Disconnect your Personal Pieces Cloud​

You can connect and disconnect from your personal cloud using Pieces: Connect Personal Cloud or Pieces: Disconnect Personal Cloud command in your command palette.

Core Features​

Pieces Copilot​

Get coding assistance from the Pieces Copilot. Ask for help with commenting, debugging, or generating snippets to save to Pieces with just a few clicks.

Open the command palette and select Pieces: Copilot to get started.

Ask Copilot in Sublime​

You can ask Copilot in Sublime by using the command Pieces: Copilot. You can ask for help with commenting, debugging, or generating snippets to save to Pieces with just a few clicks.

Use Code Context with Copilot​

You can also ask Copilot about the current project or file by using the commands:

  • Pieces: Ask about the current project
  • Pieces: Ask about the current file
Ask Copilot in Sublime

Code Snippet Management​

Manage your saved materials with ease. Save, open, edit, and share your snippets directly from Sublime. You can also search for saved materials using fuzzy search, full-text search, or neural code search.

Save to Pieces​

Save your code snippets to Pieces with a simple right-click. 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!

Save to Pieces in Sublime

Edit Saved Materials​

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. It's that easy!

Edit Saved Materials in Sublime

Share Your Code​

Ever wanted to share a code snippet effortlessly? Select the code, right-click to open the context menu, and choose Pieces > Generate shareable link. You can also share a saved material by opening it and clicking the Share button. Sharing has never been simpler!

Shareable Link in Sublime

Search Your Saved Materials​

You can search a saved material using Pieces: Search.

There are three main types of searching:

  • Fuzzy Search: Fuzzy Search is a technique used to find matches 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 is a technique that 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.

Search Saved Materials in Sublime

Open Your Saved Materials​

Ready to access your saved materials? It's super easy! Just follow these steps:

  1. Open your command palette (Ctrl+Shift+P or Cmd+Shift+P).
  2. Run the command: Pieces: Open Saved Material.
  3. Select the asset you wish to open from the list.

Your material is now open and ready for you to use. Happy coding!

Sublime Snippet Management​

You can import and export Sublime snippets to and from Pieces. Here's how you can do it:

  • 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 into Sublime.

Configuration​

Before diving in, let's ensure everything is set up to your liking. You can customize settings like your active LLM model and many others by navigating to: Preferences > Package Settings > Pieces > Settings.

You can also open the settings from the command palette Pieces: Open Settings.

Change Your LLM Model​

Want to customize your Copilot experience? You can easily switch the LLM model to better suit your needs. Open the settings from your command palette by selecting Pieces: Open Settings. You can change some configuration and choose the model that works best for you. Tailor your Copilot to be the perfect coding companion!

Troubleshooting​

Reload the Plugin​

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.

Get Support or Share Feedback​

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.

Privacy and Data Collection​

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.

Read more about data collection and privacy