From e772808a5b0417e4d074eb9683d79376f83dae2d Mon Sep 17 00:00:00 2001 From: Omnikar Date: Tue, 31 Aug 2021 05:13:16 -0400 Subject: Shell commands (#547) * Implement shell interaction commands * Use slice instead of iterator for shell invocation * Default to `sh` instead of `$SHELL` for shell commands * Enforce trailing comma in `commands` macro * Use `|` register for shell commands * Move shell config to `editor` and use in command * Update shell command prompts * Remove clone of shell config * Change shell function names to match prompts * Log stderr contents upon external command error * Remove `unwrap` calls on potential common errors `shell` will no longer panic if: * The user-configured shell cannot be found * The shell command does not output UTF-8 * Remove redundant `pipe` parameter * Rename `ShellBehavior::None` to `Ignore` * Display error when shell command is used and `shell = []` * Document shell commands in `keymap.md`--- book/src/keymap.md | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'book') diff --git a/book/src/keymap.md b/book/src/keymap.md index 61378863..d85fb936 100644 --- a/book/src/keymap.md +++ b/book/src/keymap.md @@ -122,6 +122,16 @@ in reverse, or searching via smartcase. | `[D` | Go to first diagnostic in document | `goto_first_diag` | | `]D` | Go to last diagnostic in document | `goto_last_diag` | +### Shell + +| Key | Description | Command | +| ------ | ----------- | ------- | +| `\|` | Pipe each selection through shell command, replacing with output | `shell_pipe` | +| `A-\|` | Pipe each selection into shell command, ignoring output | `shell_pipe_to` | +| `!` | Run shell command, inserting output before each selection | `shell_insert_output` | +| `A-!` | Run shell command, appending output after each selection | `shell_append_output` | +| `$` | Pipe each selection into shell command, removing if the command exits >0 | `shell_keep_pipe` | + ## Select / extend mode I'm still pondering whether to keep this mode or not. It changes movement -- cgit v1.2.3-70-g09d2