[pahy-pyoo-proh-fuhn, pahy-peh-proh-fen]; noun
Run a bash shell command on the selected lines.
Execute a bash process that pipes the selected lines as if they were an input file, same as stdin, through a custom bash shell command. The output from the process replaces the selection with stderr and stdout. Works with multiple carets by piping each selection region separately into their own process. Also works with no carets.
General usage instructions
Invoke with
ctrlaltshiftx,
or by selecting text and right-click the editor to show the
context menu. The menu item is called Pipe selected text
to bash. When no lines are selected, use the keyboard
shortcut to open the bash argument window.
Features
- Remembers the last command arguments
- Treats output containing either stderr and stdout the same
- Works with multiple carets, 1 caret and no carets
- Bug-free on Linux
- Actively supported - open an issue on github
- Unlicensed, free public domain source
Note: you must have bash in your environment's PATH.
Being able to run anything in the editor and change the buffer text was heavily inspired by emacs's lisp expressions (eval-last-sexp), (eval-defun) and (eval-expression). This plugin is intended to be a drop-in replacement for the antiquated Shell Process plugin.
default keymap: ctrlaltshiftx
- highlight lots of text
- note: works for multiple carets, too (latest jetbrains)
- press keyboard shortcut
- enter the command that bash runs
for each selection block s
create temp file f from s characters
show prompt to get args
pipe f as stdin to `bash -c ${args}`
replace s with (stdout + stderr)
remove selection
the demo below was created from this screencast.md file
Praise God, St. Benedict and the
sqlite coc
#usethatword
#nationalism
🇺🇸 🇺🇸 🇺🇸
- option toggles keep/replace selected text
- default no args text to
xargs -I{} bash -c '{}'
- or create a token to simplify the re-typing of common args
- environment variables
- history holding of previous args (and inputs? meh)
- ingest
args
from clipboard, like so$(bash -c clipboard)
- customize
bash -c
in case bash is not present - tokenize editor contents to use tokens as a testing framework
- e.g.: read editor contents, parse AST, pipe code to bash args
Thank you for using my plugin, no bullshit. Help me improve it by loggin' a bug.
Cheers!
Copyright (c) 2018 Unbearable Professional
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.
In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to http://unlicense.org/