Re:Show HN: Z shell configuration, zsh startup files, when t...
by opk on Thursday October 17, 2019 @05:02AM
(#21280129)
For zsh, you'd be better off handling functions via the function autoloading mechanism rather than defining them all from .zshenv. It is common to create a directory named ~/.zfunc (or similar), add that to $fpath and autoload the contents. This is rather more efficient than predefining them all as you would in bash.
That said, looking at your functions, a function which just runs rsync with a bunch of options and "$@" should either be done via an alias (which preserves zsh rsync completion) or as an rsync alias in ~/.popt.
Re:Show HN: Z shell configuration, zsh startup files, when t...
by jph on Thursday October 17, 2019 @05:11AM
(#21280182)
Excellent, thank you for the constructive advice! I'll start in on it.
Re:Show HN: Z shell configuration, zsh startup files, when t...
by bloopernova on Thursday October 17, 2019 @08:17AM
(#21281190)
That's good advice, thank you.
Re:Show HN: Z shell configuration, zsh startup files, when t...
by curiousbiped on Thursday October 17, 2019 @04:06PM
(#21285874)
I'd do that as a zsh plugin. If you do one that's oh-my-zsh compatible, it'll work with most of the frameworks, and you can install it by hand if you're running bare ZSH.
Then they just need to occasionally `git pull` to get updates to your company script collection.
I wrote a brief set of guidelines at https://github.com/unixorn/awesome-zsh-plugins/blob/master/W...
If you have them use a ZSH framework, (I recommend https://github.com/tarjoilija/zgen for load speed), the good ones can handle the periodic pulls for you automagically.
We are experiencing many developers switching from bash to zsh because of the recent macOS Catalina OS upgrade, and we want to show how bash and zsh can be configured similarly.
We want to easily clone a group of shell helpers (aliases, functions, etc.) that can use our preferred conventions and abstractions, and can run on a wide range of systems.