Re:Zshell
by tmtvl on Thursday March 07, 2024 @11:46AM
(#39631171)
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.
[ Parent
| on HN ]
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.
There have been decades of work on file name completion put into Emacs, nothing I’ve seen comes close. Currently I’m using add on packages vertigo, orderless, marginalia, consult, embark, and corfu to handle completion. These packages all work together to produce a crazy good setup, but in the past I’ve used helm, ivy, icicle, and vanilla Emacs. Every one of these open source completion frameworks works great.
Of course, I’ll never get back the time spent fiddling with my 1600 line Emacs configuration file.
Oh man, I've tried using Ivy, but it's terrible. I tried typing '~/.c/r/r' to quickly get to my RetroArch config file, and I immediately got stuck in '~/.cache'. With Vertico it Just Works (R). Icomplete (whose vertical mode is part of Emacs now) can also do it, but I prefer Vertico's UX as the way Return and 'C-j' work in Icomplete is opposite to what I naturally expect and rebinding them doesn't work that well.
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.
About the completions, that may be:
autoload -Uz compinit
compinit
zstyle ':completion:*' menu select
Re:Zshell
by mixmastamyk on Thursday March 07, 2024 @05:29PM
(#39635375)
Huh, fish does this too, thanks!
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!)