You asked me to open a new issues for that. So my problem is that for my setup, the directory and file suggestions are not ordered properly. The comment in the linked thread is explaining it more exhaustively, but in short do frequently used directories appear before local directories. Which is really annoying. You said this is not the case for you. So here is my minimal .zshrc trying to make this issue reproducable. But unfortunately does this minimal setup not provide any frequently used directories suggestions. Please help me to complete this configuration so we can watch out for the actual issue.
source /home/thore/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-marlonrichert-SLASH-zsh-autocomplete/zsh-autocomplete.plugin.zsh
fpath+=( /home/thore/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-marlonrichert-SLASH-zsh-autocomplete )
zstyle ':completion:correct-word:*' max-errors 0
zstyle ':autocomplete:*' groups 'always'
zstyle ':autocomplete:(slash|space):*' magic 'off'
zstyle ':autocomplete:tab:*' completion 'cycle'
zstyle ':autocomplete:tab:*' completion 'select'
My current checked out version is 5c0313ec66141226fcbd7cff9d27799a45a50ef4 (should be most recent).
Some slightly off-topic comments on your config:
zsh-autocomplete to your $fpath. Sourcing it is enough.zstyle ':completion:correct-word:*' max-errors 0 should not be necessary when you have zstyle ':autocomplete:(slash|space):*' magic 'off'.zstyle ':autocomplete:tab:*' completion twice, then the last value will override the first one.Anyway, I cannot reproduce it. Here's what I did:
.zshrc file in it:shell
cd "$(mktemp -d)"
touch .zshrc
.zshrc file to enable fasd integration:shell
eval "$(fasd --init zsh-hook)"
.zshrc file, but without loading any global config files (such as /etc/zshrc):shell
ZDOTDIR=$PWD zsh -f
fasd suggestions.I tried it and it works fine: Local directories are shown first and below them I see frecent dirs.
Can you please try these steps and see if the problems persists?
By the way, I noticed that in your minimal config, you are not initializing fasd in any kind of way. If you don't, then zsh-autocomplete will not offer any a frecent dirs. Are you sure they're not coming from somewhere else?
@marlonrichert I actually thought that i just followed your documentation.
The fpath is done by Antibody. :shrug:
@marlonrichert interesting. I expected something like that. But since I don't do it myself (as I know...). Need to fix that or investigate on my setup.
I actually thought that i just followed your documentation.
OK, maybe I need to improve the documentation, then.
Anyway, to clarify for you:
max-errors. You might want to re-read it. I think you might have gotten confused by some of the beta instructions I wrote before this was available on master. 🙂 Hey, sorry for the long delay.
Following your exact approach does not work for me. Somehow the $ZDOTDIR environment variable is never used (echo on the variable in the spawn shell shows the old value). Anyways I simply abused my actual .zshrc. And yes you are right: local directories are displayed before frequent or recent used directories. So something in my configuration I'm not aware of is causing that. Do you have an idea what could affect the group order? So where I must investigate?
Other topic I released. Sorry for raising that here, but hopefully it is short and simple. I sometimes have directories with multiple folders having the same prefix. E.g. name-cli, name-ui or name-lib (pretty much random chosen). Then I prefer to type the appendix (here cli, ui or lib) to navigate. But I don't get a suggestion for it. Why is that? And it is the same for this minimal setup here. :D
Not sure if that helps. But this is how my fasd setup looks like this:
FASD_CACHE="${ZSH_CACHE_DIR}/fasd-init-cache"
FASD_OPTIONS="posix-alias zsh-hook zsh-ccomp zsh-ccomp-install zsh-wcomp zsh-wcomp-install"
if [[ "$(command -v fasd)" -nt "$FASD_CACHE" ]] || [[ ! -s "$FASD_CACHE" ]]; then
fasd --init "$FASD_OPTIONS" >|"$FASD_CACHE"
fi
source "$FASD_CACHE"
Okay they solution is simple. The initialization of fasd must happen after this plugin has been sourced. That's it. Thanks for the help!
Appeared it works for directories now, but not files...
@weilbith Two things:
zsh-autocomplete, then you do not need the zsh-ccomp zsh-ccomp-install zsh-wcomp zsh-wcomp-install options for fasd --init. Using those options will install fasd's own completion handling, which is leading to the surprising results you're seeing. You can remove those.dev branch that might improve fasd handling.Can you try out both of these?
Cool thanks for that. I will check it out soon! :+1:
Maybe before I do so: I just "found" this in my .zshrc. It takes part after I source/load all plugins. Do I still need that, does it not hurt too keep or will it actually hurt this plugin here?
autoload -Uz compinit
compinit -d $XDG_DATA_HOME/zsh/zcompdump-$ZSH_VERSION
You don’t need it. zsh-autocomplete already does it for you: https://github.com/marlonrichert/zsh-autocomplete/blob/7f727126a84365323d7eedc739618c883614761e/zsh-autocomplete.zsh#L56
I sometimes have directories with multiple folders having the same prefix. E.g.
name-cli,name-uiorname-lib(pretty much random chosen). Then I prefer to type the appendix (herecli,uiorlib) to navigate. But I don't get a suggestion for it. Why is that?
This seems to be an edge case that's currently not handled correctly by the matching algorithm, in part because of the inclusion of recent dirs. Thanks for reporting! I'll fix it.
But next time, please file a separate issue for it. 😉
- I've made some changes on the dev branch that might improve fasd handling.
Finally found some time to test it. Works fine for me. Pretty great because that was annoying me already a while. xD
I guess when you close this issue I can assume that it was merged to master? :upside_down_face:
This seems to be an edge case that's currently not handled correctly by the matching algorithm, in part because of the inclusion of recent dirs. Thanks for reporting! I'll fix it.
Thanks! :pray:
But next time, please file a separate issue for it. :wink:
I'm sorry you are right! :see_no_evil:
I guess when you close this issue I can assume that it was merged to
master? :upside_down_face:
Yes, that is correct.
@weilbith Now available on master.