From a7adc184630fbbf28c31fadc1f96aa074661c180 Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Wed, 25 Sep 2024 16:43:48 -0400 Subject: [PATCH] add = to convert program to full path --- modules/common/shell/fish/default.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/common/shell/fish/default.nix b/modules/common/shell/fish/default.nix index 3b7e615..1e5e7f8 100644 --- a/modules/common/shell/fish/default.nix +++ b/modules/common/shell/fish/default.nix @@ -76,6 +76,10 @@ description = "Full git commit on notes"; body = builtins.readFile ./functions/syncnotes.fish; }; + _which = { + description = "Identify the path to a program in the shell"; + body = "command --search (string sub --start=2 $argv)"; + }; }; interactiveShellInit = '' fish_vi_key_bindings @@ -101,6 +105,13 @@ "-" = "cd -"; mkd = "mkdir -pv"; + # Convert a program into its full path + "=" = { + position = "anywhere"; + regex = "=\\w+"; + function = "_which"; + }; + # System s = "sudo"; sc = "systemctl";