Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I run an external command on the current selection in VS Code?

I'm currently switching editors from Vim to VS Code. One feature I like in vim is the ability to run an external command on a region of text (the :! command). I've been unable to find an obvious equivalent in VS Code.

Is this feature available in VS Code? Or is there an extension that provides it?

(As a more general question, what's the best way of finding out things like this? Is there a website or anything that describes how to do common tasks from other editors in VS Code?)

like image 795
Paul Moore Avatar asked Feb 05 '17 22:02

Paul Moore


2 Answers

For the record, VSCodeVim allows you to do the same thing.

enter image description here

like image 194
horace he Avatar answered Sep 28 '22 07:09

horace he


Having searched some more (the key term is "filter the selection") I found the Filter Text extension, which does exactly what I want.

like image 35
Paul Moore Avatar answered Sep 28 '22 06:09

Paul Moore