-
-
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
Support "bang" operations on selected code blocks #3136
Comments
Hmm... Shift-V to select lines, then |
(It could also have broken in the recent VSCodeVim release; I'm not sure if it was VSCode upgrade that broke it) |
I uninstalled some extensions and reloaded and this works again... Could have been a conflict or it could have been that the behavior is just finnicky. Will comment again if it breaks again and a reload fixes it. |
Thank you for VSCodeVim! It's fantastic. ✅ Should these work? Please consider this post a feature request if these are not currently implemented. VSCodeVim 1.10.2 |
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
Hey @sjackman, I separated the filter operators like |
Thank you very much, JR! |
AFAICT, this is either broken again, or never completely fixed. I can find no working way to select and sort text using I have a recollection of it previously working, so it may have broken recently, but I don't trust my memory here as I jump back and forth between vscode and neovim regularly. |
Hey @catskul, yeah I think this was sorta broken by a recent commit, but I have a fix for it and I'll put up a PR soon. In the meantime you can use |
Line range tests didn't catch the recent regression where selection ranges were ignored in the bang command. Fixes #3136 (again)
Is your feature request related to a problem? Please describe.
With standard Vim I regularly use block-select to pick a group of lines and then pass them to a piped Unix filter, e.g.
:'<,'>!sort|uniq
. As best I can tell, this isn't possible with the VSC Vim plugin today.Describe the solution you'd like
Support "bang" (
!
) operations when in command modeDescribe alternatives you've considered
I don't know another way to do this. Right now if it is important enough I cut and paste the content into an empty document in Vim, do the operation there, then cut and paste the content back in to Visual Studio Code.
The text was updated successfully, but these errors were encountered: