DEV Community

Cover image for Introducing Pieces for Sublime: The First Conversational Copilot in Sublime Text
Pieces 🌟
Pieces 🌟

Posted on • Originally published at code.pieces.app

Introducing Pieces for Sublime: The First Conversational Copilot in Sublime Text

Introducing Pieces for Sublime Text.

Sublime Text is a well-known text editor among developers of all levels of expertise and is favored for its lightweight aesthetics and well-rounded features–but it could be even better.

That’s why Pieces is excited to announce the launch of its newest plugin, Pieces for Sublime, the first AI-powered copilot for Sublime Text that brings conversational capabilities to your coding environment!

With Pieces for Sublime, you can now interact with your code in several ways, like asking direct questions to your preferred cloud-based or local LLM, receiving real-time code assistance, and saving code snippets.

We’ve developed this plugin based on extensive feedback from developers within our community, so we can’t wait to see what you build with it.

Get started with the Pieces for Developers Sublime Plugin now!

An AI Copilot with Q&A Capabilities

Are you tired of constantly switching contexts to look at Stack Overflow, search Google, use web-based LLMs, or dig through files to find the answers you need?

We’d bet the answer is probably yes.

To combat this issue, we designed the Pieces plugin for Sublime to be the first AI-powered copilot for Sublime Text with conversational AI capabilities.

The Pieces for Sublime Plugin does more than just suggest auto-completions for code–it encourages intelligent copilot interactions by offering in-window LLM conversations that leverage the full context of your codebase or file.

And, unlike many other plugins, the Pieces Copilot for Sublime Text suggests snippets from your repository where applicable for a more context-aware coding experience.

In this way, the Pieces for Sublime Plugin helps you brainstorm potential solutions and make smarter decisions when writing and debugging your code.

Chatting about code in Sublime Text with Pieces Copilot.

Add Hassle-Free Code Comments

One of the jobs of team leads is to make sure junior developers understand a project’s codebase.

Fortunately, the Pieces for Sublime Plugin makes that process dirt simple.

By selecting the add code comments feature, developers can generate clear, intelligent documentation to make sure everybody understands every function and section of the code.

Adding Code Comments with Pieces for Sublime.

Debugging with Natural Language

You can also use the Pieces Copilot debug feature to enter a specific error message, or simply ask it to look for errors in your selected code–all using natural language.

That’s one of the most differentiating features of the Pieces for Sublime Plugin–the ability to use creative AI prompts within the context of your active file, or even from other repositories, entire folders or files, and snippets you have saved to Pieces for exceptionally relevant results.

Asking Pieces Copilot to fix a bug in Sublime.

Auto-Complete, Automatically

The Pieces plugin for Sublime has snippet auto-complete enabled by default, which auto-completes snippets from your saved materials within your repository.

This can be disabled anytime within the plugin's settings, but it’s an especially useful tool for reusing boilerplate code, tests, scripts, and more.

Using auto-complete in the Pieces Sublime plugin.

Choosing Your Large Language Model

Do you like using Llama 3? What about Claude 3.5 or GPT-4o?

In the Pieces plugin for Sublime, you can choose which LLM is used for all conversational and AI-powered activity, giving you freedom of control over your programming environment.

There are over 20 LLMs to choose from, including a host of cloud-based and on-device LLMs depending on your machine and security preferences. Learn what the best LLM is for you, and leverage it right inside Sublime!

Opening the Pieces plugin settings.

Integration with Pieces OS

Keep in mind that using Pieces OS is the only way to use the Pieces for Sublime Text plugin. The OS powers the Pieces Copilot plugin for Sublime as well as the desktop app and any other Pieces plugins you have installed, so you’ll want to make sure you download it.

It enables live context, on-device AI usage, and snippet management within the Pieces for Sublime Plugin–all the tools you need to make your workflow efficient and powerful.

Plus, you can log into your Pieces account inside the Pieces for Sublime Plugin to enable cloud functionality, add snippets to GitHub Gists, back-up and sync your saved materials, and more.

Effortless Code Snippet Management

Managing and saving your code snippets to your centralized on-device repository has never been easier–just right-click on a selected piece of code and select Save to Pieces.

For example, you can use this feature to save reusable pieces of code like unit tests, functions, and scripts to maintain better organization and expedite the coding process for future projects.

Snippets are more than just saved pieces of code, though–thanks to our auto-enrichment feature, they include associated tags, an AI-powered smart title and description, suggested searches, and links to related resources as well as the origin URL or repo.

A code snippet displaying its associated enrichment.

Three Ways to Search

The Pieces for Sublime Plugin offers three different ways to search through your repository, helping developers like you save valuable time by quickly finding your snippets.

  • Fuzzy Search returns results that are likely to be relevant to your query, even if they aren’t a perfect match
  • Full-Text Search searches assets that contain a specific sequence of words in a query, allowing for fast and efficient searching
  • Neural Code Search leverages neural networks and machine learning to return relevant results by allowing you to use natural language to describe what you’re looking for

Edit and Customize your Snippets

With the Pieces plugin for Sublime, you can save snippets of code to your local repository, find saved code with the intelligent searching feature, and open up tabs containing these snippets.

Once opened, you can edit snippets and resave them to update and improve your code.

Saving a snippet to Pieces.

Sharing Snippets with Your Team

Sharing snippets has never been easier with the Pieces for Sublime Plugin.

Simply open a snippet from the saved materials list or right-click on any code in your active file and generate a shareable link, allowing you to quickly share code AND context with team members and other developers.

Sharing a snippet with Pieces.

An Open Source Project

The Pieces for Sublime Plugin was developed due to numerous requests from our community, so to continue the theme of collaboration and innovation here at Pieces, we’ve made the Pieces for Sublime Plugin completely open source.

This lets you contribute by starting conversations, suggesting improvements, and adding new features to truly make it your own.

Get involved with the Pieces for Sublime Plugin today by making your first contribution on our GitHub!

Getting Started with Pieces for Sublime Text

There’s so much you can do with the Pieces for Sublime Plugin. You can learn more about its features by reading through the documentation here.

Top comments (0)