MichaelAquilina / zsh-you-should-use

📎 ZSH plugin that reminds you to use existing aliases for commands you just typed
GNU General Public License v3.0
1.41k stars 44 forks source link

Request: Option to match only typed command without path #109

Open pinpox opened 3 years ago

pinpox commented 3 years ago

Issue Details

It would be very helpful to have the option to ignore the path typed when searching for existing aliases for the input.

E.g. supposed this alias is configured:

alias gc="git commit"

These inputs should all be mached:

git commit              # works
/usr/bin/git commit # does NOT work
./git commit            # does NOT work

This behaviour could be made optional and will help to make the plugin useful for "hardcoded" binaries that might not be in $PATH.

Apart form binaries that the user might not want to have in $PATH for whatever reason, this would fix the usage on nixOS where it is common practice to have shell configs and scripts generated like alias gc="${pkgs.git}/bin/git commit" (pkgs.git gets expanded to wherever the binary might be in the packge)

Operating System (uname -a)

Linux kartoffel 5.4.70 #1-NixOS SMP Wed Oct 7 06:01:31 UTC 2020 x86_64 GNU/Linux

zsh version (zsh --version)

zsh 5.8 (x86_64-pc-linux-gnu)

you-should-use version (echo "$YSU_VERSION")

1.7.3

How is zsh-you-should-use installed?

Steps to reproduce the issue

alias e="/bin/echo"
echo "something"

gist link to your zshrc

https://gist.github.com/pinpox/87e1b4e2d2cbeff2c26c1aa6177294ff