-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
External Filter support #3154
Comments
I would love to see this feature added, one of the most powerful features in Vim for regular use! |
I also use this feature all the time in vim, to run all sorts of command-line filters on the code, This extension helped me give vscode a chance, but this feature is a must-have IMHO, along with |
J-Fields
pushed a commit
that referenced
this issue
Jul 6, 2020
This PR ports the :!{cmd} bang command from Vim, allowing external shell commands to be run directly from Vim's command mode. Key features: - :!{cmd} executes the shell command - :{range}!{cmd} executes the shell command, pipes the line range to stdin, and replaces the line range with the output from stdout and stderr - Embedded bangs are replaced with the previous bang command (e.g. :!dir => :!echo ! will execute echo dir) - Cross-platform, supports Unix and Windows shells Fixes #3154, fixes #3136, fixes #3069, fixes #4920
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
:{range}!
is a common idiom for running an external filter likeawk
orjq
for processing data. Currently all commands fail with "Not an editor command"Describe the solution you'd like
:! foo
would executefoo
and pipe the result to the Output tab:<range>!foo
would executefoo
, using the specified lines as stdin, and replacing those lines in the file with the output from the command. stderr would be piped to Output.Describe alternatives you've considered
An alternative is to run a parallel instance of vim and perform those operations on the vim instance, relying on the fact that both vscode and vim will detect if the file changed, but that's not exactly a great solution
Additional context
See
:help filter
for more info on the family of commandsThe text was updated successfully, but these errors were encountered: