9 ms·
One nice thing in zsh is that you can type `/u/lo/b<tab><return>` and be in `/usr/local/bin`.
by daffy 6y ago
One nice thing in zsh is that you can type `/u/lo/b<tab><return>` and be in `/usr/local/bin`.
- enriquto 6y agoBash does the same thing here, typing tabs instead of slashes. /u<TAB>lo<TAB>b same number of keystrokes actually
- Nullabillity 6y agoNot quite. Zsh can use the subfolders to disambiguate which parent you meant, bash can't.
- enriquto 6y agoWow. While this is quite slick (and must have been funny to implement), I actually hate this kind of "magic" behavior.
- pletnes 6y agoHow is it more or less magic than bash’s? It takes more context into account, sure, but it’s easy to understand and reason about.
- polack 6y agoI usually hate magic too, but I have to say this is one of the cases where I like it. It's convenient without any danger attached to it since you're just switching directory and not actually executing something against this "unknown" path.
- Jach 6y agoFor about a decade I've had in my bashrc C() { cd `$HOME/path-selector.sh "$@"`; } where path-selector is from https://github.com/MarcWeber/path-selector https://github.com/MarcWeber/path-selector Opt-in bash extensions can do basically whatever people complain bash can't do. Though to be honest I don't use it that much over the last, say, 5 years. If I know a deep directory tree that well, I can just type it explicitly and/or tab complete it without losing much time. If I don't know it that well, FZF is quite nice.
- nostoc 6y ago"bash: /usr/local/bin/: Is a directory" What to you have in your bashrc to allow cd'ing in directories without typing cd?
- enriquto 6y agoI prefer to type "cd", the directory-as-executable feature is a bit confusing for me. But you can enable it in bash, the option has the same name as in zsh: autocd. Just run "shopt -s autocd".
- ti_ranger 6y agoThis is one of my primary dislikes of zsh ...