From 46f7cdb5a94fcc831418eccc5301fe5195b0e1b5 Mon Sep 17 00:00:00 2001 From: Jason Fuchs <157738564+jasonfuchs@users.noreply.github.com> Date: Mon, 7 Apr 2025 18:00:45 +0200 Subject: [PATCH] feat: add ! alias for sh and | for pipe (#13263) --- book/src/generated/typable-cmd.md | 4 ++-- helix-term/src/commands/typed.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/book/src/generated/typable-cmd.md b/book/src/generated/typable-cmd.md index dc5a6d08a..219f6b95f 100644 --- a/book/src/generated/typable-cmd.md +++ b/book/src/generated/typable-cmd.md @@ -78,9 +78,9 @@ | `:log-open` | Open the helix log file. | | `:insert-output` | Run shell command, inserting output before each selection. | | `:append-output` | Run shell command, appending output after each selection. | -| `:pipe` | Pipe each selection to the shell command. | +| `:pipe`, `:|` | Pipe each selection to the shell command. | | `:pipe-to` | Pipe each selection to the shell command, ignoring output. | -| `:run-shell-command`, `:sh` | Run a shell command | +| `:run-shell-command`, `:sh`, `:!` | Run a shell command | | `:reset-diff-change`, `:diffget`, `:diffg` | Reset the diff change at the cursor position. | | `:clear-register` | Clear given register. If no argument is provided, clear all registers. | | `:redraw` | Clear and re-render the whole UI | diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs index a7d1c5f03..5274c2801 100644 --- a/helix-term/src/commands/typed.rs +++ b/helix-term/src/commands/typed.rs @@ -3450,7 +3450,7 @@ pub const TYPABLE_COMMAND_LIST: &[TypableCommand] = &[ }, TypableCommand { name: "pipe", - aliases: &[], + aliases: &["|"], doc: "Pipe each selection to the shell command.", fun: pipe, completer: SHELL_COMPLETER, @@ -3466,7 +3466,7 @@ pub const TYPABLE_COMMAND_LIST: &[TypableCommand] = &[ }, TypableCommand { name: "run-shell-command", - aliases: &["sh"], + aliases: &["sh", "!"], doc: "Run a shell command", fun: run_shell_command, completer: SHELL_COMPLETER,