4 ms·
This will hang if you have too many subdirectories (e.g., a good-sized company's monorepo). A networked volumes will also often cause it to hang. (PS: In Zsh `
by robenkleene 1y ago
This will hang if you have too many subdirectories (e.g., a good-sized company's monorepo). A networked volumes will also often cause it to hang.
(PS: In Zsh `cd -<tab>` will show a pop up menu of all directories in the history stack.)
- sandreas 1y agoSeems to be some kind of oh-my-zsh thing... cd - <TAB> does not work on my zsh config.
- robenkleene 1y agoAh, good point, this isn’t `oh-my-zsh` but it does require a couple of options to work as described: 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).
- sandreas 1y agoWorks, is really nice, thank you. May I (auto-)suggest: https://github.com/zsh-users/zsh-autosuggestions https://github.com/zsh-users/zsh-autosuggestions Have fun ;-)