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

Question/suggestion: printing alias content before execution #113

Open nivgsk opened 2 years ago

nivgsk commented 2 years ago

Issue Details

Operating System (uname -a)

Linux NivG-T490 5.4.0-104-generic #118~18.04.1-Ubuntu SMP Thu Mar 3 13:53:15 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

zsh version (zsh --version)

zsh 5.4.2 (x86_64-ubuntu-linux-gnu)

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

1.7.3

How is zsh-you-should-use installed?

Question/Suggestion

I have an idea that I wanted to document in an issue, in order to:

  1. Ask if the idea is feasible at all.
  2. If it is, then maybe take up on it when I can.

Would it be possible to use the existing framework to check if a command that has been entered is an alias, and if so, also print the full command before running it?

So an example execution would look something like this:

$ git pull
Found existing alias for "git pull". You should use: "gl"

$ gl
Running an aliased command: "git pull"
Already up to date.
MichaelAquilina commented 2 years ago

It's definitely possible and shouldnt be too difficult

I would make it an optional feature that is purely opt in.

I cant promise I will work on something like this anytime soon, but feel free to give it a go if you want :)