source <(fzf --zsh) > /dev/null
and the ** shortcut followed by <TAB>, e.g. cd ~/** # <TAB>
along with cd - to change to the directory before cd - source <(fzf --zsh) > /dev/null
and the ** shortcut followed by <TAB>, e.g. cd ~/** # <TAB>
along with cd - to change to the directory before cd -(PS: In Zsh `cd -<tab>` will show a pop up menu of all directories in the history stack.)
1. `setopt autopushd pushdsilent`: This is the key component, `autopushd` automatically adds directories to the directory stack (and `pushdsilent` option does it without echoing added directories). Without this option, there’s no directory stack to traverse (unless directories are first manually added to it with `pushd` [for completion, `popd` pops directories off the stack navigating back to those directories]). `autopushd` just calls `pushd` on the current directory after each `cd`.
2. To get a menu, Zsh completion also has to be loaded, e.g., `autoload -Uz compinit && compinit -C`
3. Finally `zstyle ':completion:*' menu select` is optional, but that highlights the selected match, which is a nicer UI in my opinion.
Those are the options I used to get this working with `zsh -f` (which starts Zsh with a default config).
May I (auto-)suggest:
https://github.com/zsh-users/zsh-autosuggestions
Have fun ;-)
> fd -t d | wc -l
213842
takes 5 seconds.Population doing `cd ~/**<tab>` takes way way longer than 5 seconds though.
But regardless of the speed up one could add to cd + fzf in this case, I will still be using zoxide:
> zoxide query -l | wc -l
1294
and `zi` starts instantaneous if I need the dynamic filteringedit: layout