My favourite Zsh features
code.joejag.com
My favourite Zsh features
1–10 of 44 posts
Re: My favourite Zsh features
#2Re: My favourite Zsh features
#3 ls something
will complete to ls prefixSomething.sh
if it's unique enough. This is probably my single favorite zsh feature.Re: My favourite Zsh features
#4The tab completion isn't limited to the beginning of file names either. Useful when many of your file names start with the same pattern but then diverge. ls something will complete to ls prefixSomething.sh if it's unique enough. This is probably my single favorite zsh feature.
Re: My favourite Zsh features
#5This is not to say that zsh doesn't have a lot more features, just that the comparison from the perspective of an osx user tends to be a lot more stark.
Re: My favourite Zsh features
#6 rationalise-dot() {
if [[ $LBUFFER = *.. ]]; then
LBUFFER+=/..
else
LBUFFER+=.
fi
}
zle -N rationalise-dot
bindkey . rationalise-dot
When you hit ... it will produce a slash and a ../ for each . you type after that.Re: My favourite Zsh features
#7The tab completion isn't limited to the beginning of file names either. Useful when many of your file names start with the same pattern but then diverge. ls something will complete to ls prefixSomething.sh if it's unique enough. This is probably my single favorite zsh feature.
Having gotten used to ido in emacs, I must say that I am now disappointed in most all autocompletes. Shame it doesn't work in the shell. (Quick, someone prove me wrong! Please! :) )
Just trying to save others some time here.
Re: My favourite Zsh features
#8all those z shell features the only useful one (i.e. the only one that's impossible on bash) is the recursion (i typed star star, but hn hides it) hack.
and it's awful. because now you just learned something that you can't use anywhere else! and to search that same way in a shell script? though luck.
also it has less parameter then find. and find is available everywhere so you can use it in scripts.
Re: My favourite Zsh features
#9The tab completion isn't limited to the beginning of file names either. Useful when many of your file names start with the same pattern but then diverge. ls something will complete to ls prefixSomething.sh if it's unique enough. This is probably my single favorite zsh feature.
Having gotten used to ido in emacs, I must say that I am now disappointed in most all autocompletes. Shame it doesn't work in the shell. (Quick, someone prove me wrong! Please! :) )
Re: My favourite Zsh features
#10Earlier quoted context omitted.
Having gotten used to ido in emacs, I must say that I am now disappointed in most all autocompletes. Shame it doesn't work in the shell. (Quick, someone prove me wrong! Please! :) )
How does ido work? Is there any demo or a quick tutorial? (I don't use Emacs.)
The real magic of ido is the completion engine. It's not made super explicit in that video, but it's actually possible to complete on arbitrary subsequences of strings you want.
With my configuration (using the popular "flx-ido" matching engine), if you wanted to match "README.md", you could achieve this by just typing ED. Even though E and D aren't consecutive, E appears before D. (But "GOOD_EDITING_SOFTWARE" would be matched before "README.md", because it prioritizes consecutive matches and characters at the beginnings of logical groups of characters.)