Live data from Hacker News

Zsh Tricks to Blow Your Mind

twilio.com

31–40 of 218 posts

Re: Zsh Tricks to Blow Your Mind

#31
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.

I'm happy in zsh or bash but the one thing I love in zsh is that completion options for program arguments. Having a list with a snippet of documentation to tab through is a huge benefit.

Re: Zsh Tricks to Blow Your Mind

#33

Earlier quoted context omitted.

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.

I'm happy in zsh or bash but the one thing I love in zsh is that completion options for program arguments. Having a list with a snippet of documentation to tab through is a huge benefit.

Bash supports completions as well.

Re: Zsh Tricks to Blow Your Mind

#34

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.

Is this OS X? Is zsh the default there?

Yes

Re: Zsh Tricks to Blow Your Mind

#35
I just recently ditched oh-my-zsh as I wanted to understand and have more control over my shell. I have to say that just using native zsh capabilities I don't miss oh-my-zsh at all.

A good guide (although a bit old and maybe too thick :) ) is this one: http://zsh.sourceforge.net/Guide/zshguide.pdf

Re: Zsh Tricks to Blow Your Mind

#36
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.

defaults matter.

Re: Zsh Tricks to Blow Your Mind

#37

Earlier quoted context omitted.

I'm happy in zsh or bash but the one thing I love in zsh is that completion options for program arguments. Having a list with a snippet of documentation to tab through is a huge benefit.

Bash supports completions as well.

IIRC, bash doesn't support extended completion editor features of ZSH, which GP alluded to - like generating a table of options with help strings that can be selected by arrow keys and the like.

Re: Zsh Tricks to Blow Your Mind

#39

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?

Re: Zsh Tricks to Blow Your Mind

#40
post #32

Do people... actually use this font in their terminal? I would go absolutely nuts looking at the spacing and color scheme.

I wouldn't be surprised if this was coerced by the marketing department, trying to imbue that "ooh, look at me, I'm a bit crazy, so creative" vibe for a bloody shopping list.
Post reply on HN