Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Convert text/code to a snippetNew to Visual Studio Code? Get it now.
Convert text/code to a snippet

Convert text/code to a snippet

Nelio Souza Santos Filho

|
6,308 installs
| (4) | Free
Convert any text or code to a snippet in output panel.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Introduction

This is a small extension for provide the capability to convert a selected text in active window to a snippet format on output channel.

What problems this extension solve?

Create a single line snippets is to easy, but when you have a multi-line snippets the problems comes bigger.

  1. Its hard to indent a multiline snippet to reflect a real format;
  2. When you need to use comments in multiline inside your snippet;
  3. Provide all the times the full structure to create a snippet (complete json);

Many developers around the world have some templates for coding repetitively things. I.e. when you have models, controllers and etc. you will repeat some blocks. Snippets can put you a step ahead by simplifying this process.

Why snippets simplify the process?

  1. You can mark some areas of your text code for quickly replace during your typping in code completation;
  2. When you change a snippet all your new codes are in the same format;
  3. A unique repository for your templates at your hand;
  4. Easly to use (via code completation);

Howto use

First of all, select the part of your code you will transform into snippet. After that, in menu "View | Command Palette" type: Convert to Snippet

Some ways to use and make the things more fun:

  • MacOS: Command+Shift+P and type -> Convert to Snippet
  • Windows: Ctrl+Shift+P and type -> Convert to Snippet

Screencast

  1. Install the extension, typing in the Search Extensions in Marketplace the title Convert text/code to a snippet
  2. Reload your vscode
  3. See the steps bellow

Screencast

Support

If you find any bugs or need an new feature or improvement, please let me know.

Nowadays, the code is in: Gitlab Code

Thank you and I hope you enjoy!

Nelio Santos (nelio@e01aio.com.br)

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft