Live data from Hacker News

Zsh Tricks to Blow Your Mind

twilio.com

41–50 of 218 posts

Re: Zsh Tricks to Blow Your Mind

#42

If you’re on 10.15 (Catalina) there’s no need to install zsh, it is the default shell. If you’ve upgraded and are still using bash, just do ‘chsh -s /bin/zsh’ to set the default to zsh.

What was the reason for them doing this do you know? From my experience with it over the last year, zsh is slightly worse at autocomplete than bash, with no advantages. Is there something I'm missing, like a good default .zshrc?

Bash licensing (GPL)

Re: Zsh Tricks to Blow Your Mind

#44
post #11

A lot of these can be easily done in Bash, too! 1. `mkcdir () { mkdir -- "$1" && cd -- "$1"; }` 2a. `bind '"\e[A":history-search-backward'; bind '"\e[B":history-search-forward'` 2b. Default behavior for Bash. 3. `shopt -s autocd` 4. `mmv`, `perl-rename` 5. `qalc` from libqalculate: https://github.com/Qalculate/libqalculate 8. Default behavior for Bash. 9. Default behavior for Bash.

This is always my complaint about posts like this. I read them looking for the killer feature to make me consider switching from bash and it's always stuff bash does natively or with a one line alias.

If the dizzying assortment of shell parameter expansion features (see man zshexpn), isn't enough to convince you, then the cause is lost.

Re: Zsh Tricks to Blow Your Mind

#45
I've been using Fish instead and it's much much simpler than configuring ZSH to my liking. It's already good out of the box, without having to carry around any kind of configuration. The only stuff I usually do is to setup `powerline-go` as prompt, and voilà, that's pretty much it.

Re: Zsh Tricks to Blow Your Mind

#47

None of these blew my mind. If you like terminal productivity I recommend: fzf, Facebook path picker (aka fpp), fd, ripgrep, lf, tig. Some honorable mentions: tokei, hyperfine, lazydocker, ctop, ncspot.

Solid selection. I'd also add nnn as the fastest tool to navigate directories I've ever seen.

Have you been able to get it to cd on quit? it's the only thing I can't seem to get. It's amazing though.

Re: Zsh Tricks to Blow Your Mind

#48
post #11

A lot of these can be easily done in Bash, too! 1. `mkcdir () { mkdir -- "$1" && cd -- "$1"; }` 2a. `bind '"\e[A":history-search-backward'; bind '"\e[B":history-search-forward'` 2b. Default behavior for Bash. 3. `shopt -s autocd` 4. `mmv`, `perl-rename` 5. `qalc` from libqalculate: https://github.com/Qalculate/libqalculate 8. Default behavior for Bash. 9. Default behavior for Bash.

Bash supports at least a subset of emacs motion keys. 7. C-a C-k C-y # to park a command

These are provided by Readline. Many command line programs support Readline, and for those that don’t, rlwrap is like magic (even automatically adds history!).

Re: Zsh Tricks to Blow Your Mind

#49

If you’re on 10.15 (Catalina) there’s no need to install zsh, it is the default shell. If you’ve upgraded and are still using bash, just do ‘chsh -s /bin/zsh’ to set the default to zsh.

What was the reason for them doing this do you know? From my experience with it over the last year, zsh is slightly worse at autocomplete than bash, with no advantages. Is there something I'm missing, like a good default .zshrc?

Check out ohmyzsh for a great ~/.zshrc
Post reply on HN