DEV Community

Discussion on: VS Code Extensions to become a more productive Developer 🤓🤓🤓

Collapse
 
yatki profile image
Mehmet Yatkı

Maybe this one helps someone too :)

GitHub logo yatki / vscode-surround

🔥A simple yet powerful extension to add wrapper templates around your code blocks

Surround

Visual Studio Marketplace Visual Studio Marketplace GitHub last commit License


A simple yet powerful extension to add wrapper templates around your code blocks

Features

  • Supports multi selections
  • Fully customizable
  • Custom wrapper functions
  • You can assign shortcuts for each wrapper function separately
  • Nicely formated

Demo 1: Choosing wrapper function from quick pick menu

Demo 1

Demo 2: Wrapping multi selections

Demo 2

How To Use

After selecting the code block, you can

  • right click on selected code
  • OR press (ctrl+shift+T) or (cmd+shift+T)

to get list of commands and pick one of them.

Hint

Each wrapper has a separate command so you can define keybindings for your favourite wrappers by searching surround.with.commandName in the 'Keyboard Shortcuts' section.

List of commands






























Command Snippet

surround.with (ctrl+shift+T)
List of all the enabled commands below
surround.with.if if ($condition) { ... }
surround.with.ifElse if ($condition) { ... } else { $else }
surround.with.tryCatch try { ... } catch (err) { $catchBlock }
surround.with.tryFinally try { ... } finally { $finalBlock
…




🚀🖖

Collapse
 
marian2js profile image
Mariano Pardo • Edited

Thanks for sharing this one. I'm sure I'm going to use the surrounding in <element></element> a lot.