Live data from Hacker News

Zshell

zsh.org

11–20 of 37 posts

Re: Zshell

#11
post #6

I like the path completion in zsh, being able to type ' ~/.c/x/x ', hit tab and have it autocomplete to ' ~/.config/xsettingsd/xsettingsd.conf ' is a lot nicer than ` ~/.c ', tab, tab, add an 'o', tab again, 'x', tab, tab, 's', tab, tab.

I’ve been using zsh for a while now and you just blew my mind!

Emacs' standard find-file function also does it, and I've since gotten so used to it that it's very irritating when I have to use a piece of software that doesn't complete like that.

Re: Zshell

#12
post #6

I like the path completion in zsh, being able to type ' ~/.c/x/x ', hit tab and have it autocomplete to ' ~/.config/xsettingsd/xsettingsd.conf ' is a lot nicer than ` ~/.c ', tab, tab, add an 'o', tab again, 'x', tab, tab, 's', tab, tab.

[deleted]

Re: Zshell

#13
post #3
post #2

Needs a (1990) tag. It always amuses me when people, to this day, say "eh, not going to use that newfangled zsh, bash was good enough for my forefathers and is good enough for me" - not realizing zsh was released less than a year after bash.

I tried to give zsh a shot as a bash replacement but ultimately returned to bash. My main pain point was that zsh was really difficult to configure out of the box and a lot of the completions were much slower (cpu/wall time) than the equivalent completion in bash. I'm sure some of that was simply ignorance on my part.

I have had someone sing the praises of zsh, tried it, was like "that isn't so much better than bash" and went back. Then I heard about oh-my-zsh, tried zsh with oh-my-zsh, and stayed. I still think it's not a big deal, but it is an improvement.

Re: Zshell

#14
post #6

I like the path completion in zsh, being able to type ' ~/.c/x/x ', hit tab and have it autocomplete to ' ~/.config/xsettingsd/xsettingsd.conf ' is a lot nicer than ` ~/.c ', tab, tab, add an 'o', tab again, 'x', tab, tab, 's', tab, tab.

I also use zsh for years and did not know that. What I like this: Actually having completions shown in the screen and being able to navigate them with tabs. I think that is not a default behavior, but that is what oh-my-zsh does for you in its default setup. Does someone have more insight on that?

I did not know about this, but I use https://github.com/wting/autojump, so I am not super sad that I missed something that hold me back severely. But good to know.

Re: Zshell

#15
post #8
post #3

Earlier quoted context omitted.

I tried to give zsh a shot as a bash replacement but ultimately returned to bash. My main pain point was that zsh was really difficult to configure out of the box and a lot of the completions were much slower (cpu/wall time) than the equivalent completion in bash. I'm sure some of that was simply ignorance on my part.

Bash improved a lot since the early 2000s, when I first assessed my options for shells and settled on zsh. As an interactive shell, zsh did more, and better, than any other shell I tried. Maybe it was slow, but not enough to matter at the time I used it. I guess that bash being the default practically everywhere nowadays made it so that it got a lot of love. For example, it is common to see command line tool come wit…

zsh has better completion, command line editing capabilities, and language features. It's not even close. I can port my bash configuration to zsh in mere minutes, but it's impossible to port my zsh configuration to bash. The reason is simple. Bash just lacks so many features.

> For example, it is common to see command line tool come with bash completion files, less so with zsh.

It's rare for bash to complete anything but filenames. zsh gives me subcommands and flags with descriptions.

> Also, while bash got better support where it matters, zsh mostly got bloat in the form of oh-my-zsh and the likes.

zsh is a well-maintained project. It makes no sense to ignore that and instead fault them for oh-my-zsh's shortcomings, as if it has anything to do with upstream zsh. zsh doesn't rely on oh-my-zsh for any of its features.

Re: Zshell

#16
post #6

I like the path completion in zsh, being able to type ' ~/.c/x/x ', hit tab and have it autocomplete to ' ~/.config/xsettingsd/xsettingsd.conf ' is a lot nicer than ` ~/.c ', tab, tab, add an 'o', tab again, 'x', tab, tab, 's', tab, tab.

I also use zsh for years and did not know that. What I like this: Actually having completions shown in the screen and being able to navigate them with tabs. I think that is not a default behavior, but that is what oh-my-zsh does for you in its default setup. Does someone have more insight on that? I did not know about this, but I use https://github.com/wting/autojump , so I am not super sad that I missed something th…

About the completions, that may be:

  autoload -Uz compinit
  compinit
  zstyle ':completion:*' menu select

Re: Zshell

#17
post #6

I like the path completion in zsh, being able to type ' ~/.c/x/x ', hit tab and have it autocomplete to ' ~/.config/xsettingsd/xsettingsd.conf ' is a lot nicer than ` ~/.c ', tab, tab, add an 'o', tab again, 'x', tab, tab, 's', tab, tab.

Huh, fish does this too, thanks!

Re: Zshell

#18
post #6

I like the path completion in zsh, being able to type ' ~/.c/x/x ', hit tab and have it autocomplete to ' ~/.config/xsettingsd/xsettingsd.conf ' is a lot nicer than ` ~/.c ', tab, tab, add an 'o', tab again, 'x', tab, tab, 's', tab, tab.

I find that feature also interacts very nicely when editing parallel paths. E.g.:

    prog/libs/foo┃/src/CMakeList.txt             Start with one path
    prog/libs/some┃/src/CMakeList.txt            Edit the middle part
    prog/libs/somelongname/src/CMakeList.txt┃    Press tab, completes middle and jumps to end
I was also thrilled when I noticed zsh contextually skipping some potential completions that I'd already had on my command line. E.g., if I have files `aaa` and `aab` in a directory, then hitting tab on

    git add aaa a┃
will do the right thing and immediately complete to `aab` without further prompting. (Better yet, it also does that if I'd added `aaa` with a previous command!)

Re: Zshell

#19
post #8

Earlier quoted context omitted.

Bash improved a lot since the early 2000s, when I first assessed my options for shells and settled on zsh. As an interactive shell, zsh did more, and better, than any other shell I tried. Maybe it was slow, but not enough to matter at the time I used it. I guess that bash being the default practically everywhere nowadays made it so that it got a lot of love. For example, it is common to see command line tool come wit…

zsh has better completion, command line editing capabilities, and language features. It's not even close. I can port my bash configuration to zsh in mere minutes, but it's impossible to port my zsh configuration to bash. The reason is simple. Bash just lacks so many features. > For example, it is common to see command line tool come with bash completion files, less so with zsh. It's rare for bash to complete anything…

This. Plus it's not even slow. My zsh config does x5 as much as bash while being faster. If you want it fast keep away from plugin managers like oh-my-zsh and async load as much as you can.

Re: Zshell

#20
post #8

Earlier quoted context omitted.

Bash improved a lot since the early 2000s, when I first assessed my options for shells and settled on zsh. As an interactive shell, zsh did more, and better, than any other shell I tried. Maybe it was slow, but not enough to matter at the time I used it. I guess that bash being the default practically everywhere nowadays made it so that it got a lot of love. For example, it is common to see command line tool come wit…

zsh has better completion, command line editing capabilities, and language features. It's not even close. I can port my bash configuration to zsh in mere minutes, but it's impossible to port my zsh configuration to bash. The reason is simple. Bash just lacks so many features. > For example, it is common to see command line tool come with bash completion files, less so with zsh. It's rare for bash to complete anything…

> It's rare for bash to complete anything but filenames. zsh gives me subcommands and flags with descriptions.

I think that hasn't been true for a very long time, although it might be that I'm biased because I've been installing the "bash completion" package alongside bash on all my systems. (In my case "apt-get install bash-completion".)

bash typically completes commands, sub-commands, flags, and file/directory names for me. It is also common for new tools to ship with bash-completion support, often missing support for other shells.

Post reply on HN