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";