-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some shorter aliases are not detected #79
Comments
I'm afraid this issue went past my radar without me noticing! Would you please mind posting your alias definitions to see if I can easily reproduce the issue on my machine? |
@benwaffle polite ping about this (I can't seem to reproduce this) |
@benwaffle take a look at the latest release (1.5.0). The issue should be fixed there. Thanks for reporting the issue! |
…nes" This reverts commit a0ee820.
Re-opening this issue as the feature that solved it has been reverted. |
Emmm, why the fix was reverted? |
The way the feature was implemented introduced a number of bugs. This problem is actually a lot harder than it looks to solve and will require quite a bit of thinking. |
@MichaelAquilina Can you check out how https://github.com/djui/alias-tips solves this? (Search for I use this little function to expand aliases, can't it solve this?
|
@MichaelAquilina Besides, sometimes if there exist multiple aliases for the same command, this plugin can not find the shortest one. $ alias abc=abcd ab=abcd
$ abcd
Found existing alias for "abcd". You should use: "abc" $ alias abc=abcd ab=abcd a=abcd
$ abcd
Found existing alias for "abcd". You should use: "a" The first one should be |
Also for me an issue In my .zshrc I have
Result:
I would have expected the suggestion of using the shorter |
https://github.com/djui/alias-tips is a bad solution. It literally boots up a Python interpreter every time you run a shell command, lol. It's terrible! zsh-you-should-use is much better, because it's just a fast, minimalistic, pure zsh script. But perhaps some of its algorithms can be ported to Zsh, because alias-tips is good at finding the shortest matching alias. |
Writing in python is lot easier than writing zsh scripts I says this with python as my main daily language :) Some of those algorithms might require quite a bit of work as a result. But I'd be happy for someone to try give it a go. Alternatively you can also wait for me to have the time to do it, but I cant make any promises in terms of when |
@MichaelAquilina Totally understandable. Actually, I am very happy with your plugin now, when I discovered |
This might be helpful https://unix.stackexchange.com/a/482492 |
Issue Details
Please provide the following details when opening an issue:
Operating System (uname -a)
Darwin MacBook-Pro 18.6.0 Darwin Kernel Version 18.6.0: Thu Apr 25 23:16:27 PDT 2019; root:xnu-4903.261.4~2/RELEASE_X86_64 x86_64
zsh version (zsh --version)
zsh 5.7.1 (x86_64-apple-darwin18.2.0)
you-should-use version (echo "$YSU_VERSION")
1.3.0
How is zsh-you-should-use installed?
Steps to reproduce the issue
gd --word-diff
gdw
is not recommendedBased on
alias gd='git diff'
andalias gdw='git diff --word-diff'
, I think that runninggd --word-diff
should recommendgdw
.The text was updated successfully, but these errors were encountered: