Zsh Configuration from the Ground Up
zanshin.net
zanshin.net
I spent a few hours on this about a year back and went from over 2s to about 0.15s for a full run of an interactive login shell (`time zsh -l -i -c 'echo "test"'`). No functionality lost, at least none that I actually used and cared about.
Definitely one of the best quality of life improvements I've made to my setup in recent years.
I was also worried about random code getting downloaded to my machine and getting executed.
~ time zsh -l -i -c 'echo "test"'
test
zsh -l -i -c 'echo "test"' 0.09s user 0.07s system 86% cpu 0.185 total
~So, I decided to rewrite https://github.com/banga/powerline-shell in go, and the performance is amazing.
The latency went down from several seconds to 200µs (except when git is used, then it’s ~4ms), and it’s fast enough.
The repo is at https://github.com/justjanne/powerline-go. Here’s a small video showing just how different the latency is: https://s3.kuschku.de/public/2017-08-21_16-43-41.mp4. Disclaimer: Although the original was MIT, I licensed my rewrite under GPLv3.
Improving the latency of software is just such an amazing quality-of-life improvement, it was well worth those 10 hours of work.
Who cares if it's old, if it's still relevant?
Is there something out there now that is better than zsh?
I cannot claim that it is better than zsh in every aspect yet, but it is getting there.
However, my view is that we are generally chronological beings at heart, and knowing the year that something was posted (if it wasn't the current year) is a useful to aid in determining whether we may have seen it before or whether it may be particularly relevant to our interests.
It still catches me out with its sub shells too sometimes. ( () is equiv to $() in bash )
Also. No control+R
Otherwise I think it's a beautiful shell and I keep using it.
And the up arrow already does something similar to ctrl-R by default. No need to have a separate hotkey for that behavior.
What would control+R do for you that isn't just part of the fish autocompletion?
However, I particularly found it difficult to get working with nix, unfortunately.
I remember that I was interested in it for its multiline command formatting and history. Since then, though, I've learned that zsh also has support for multiline command history, and its vi keybindings support multiline editing for a single command. It's like every command line is a little multiline vi buffer. For this reason, I've chosen my prompt so that the command starts at the first column.
Oh-my-zsh is for aliens
Also find a theme that works for you
Whoooops...