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`--- helix-term/src/keymap.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'helix-term/src/keymap.rs') diff --git a/helix-term/src/keymap.rs b/helix-term/src/keymap.rs index 492dc292..f3e160b1 100644 --- a/helix-term/src/keymap.rs +++ b/helix-term/src/keymap.rs @@ -508,6 +508,11 @@ impl Default for Keymaps { }, "\"" => select_register, + "|" => shell_pipe, + "A-|" => shell_pipe_to, + "!" => shell_insert_output, + "A-!" => shell_append_output, + "$" => shell_keep_pipe, "C-z" => suspend, }); let mut select = normal.clone(); -- cgit v1.2.3-70-g09d2