DEV Community

Cover image for Introducing SnippetShot – A VS Code Extension for Clean Code Screenshots
Bridget Amana
Bridget Amana Subscriber

Posted on

Introducing SnippetShot – A VS Code Extension for Clean Code Screenshots

As someone who tweets often and builds in public, I regularly need to show a part or snippet of my code. I’ve always done this by copying the code and using tools like ray.so or Polacode.

For those who don’t know, Polacode is a Visual Studio Code extension for creating code screenshots. I love the tool, but it’s a bit buggy, and since the maintainer is no longer active, those bugs remain. So I decided to build my own.

What is SnippetShot?

SnippetShot is a free VS Code extension that lets you turn code into clean, shareable images in seconds. Copy your code, open SnippetShot, and export a styled PNG without leaving your editor. That’s how easy it is.

SnippetShot is an updated version of Polacode, so if you were a fan of Polacode, this is the tool for you.

code screenshot taken with snippetshot

Features

  • Customizable background. Pick any color to match your style or branding.
  • Line numbers toggle. Show or hide line numbers as you please.
  • Add custom credits or text to your screenshot.
  • Twitter/X sharing. Instantly copy your image and share it.

How it works

  1. To install the extension, click the Extensions icon on the left sidebar of your editor to open the marketplace, then search for SnippetShot.
  2. After installing, open the command palette. On Windows, use Ctrl+P. On Mac, use Cmd+Shift+P.
  3. Open any file with code. Select the code, and it will appear in the editor’s right panel where SnippetShot is open.
  4. From there, you can change the background color, toggle line numbers, and add your name.
  5. Click Save or Share to Twitter.

SnippetShot also supports gradient backgrounds for more flexibility in styling.

Note: There’s another tool out there with a similar name, but mine is a pure VS Code extension.

Download the extension here. I also just launched on Product Hunt. If you find it useful, please give it an upvote there and a star on GitHub.

Top comments (0)