Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Rewrite of zsh-newuser-install
- X-seq: zsh-workers 48402
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Marlon Richert <marlon.richert@xxxxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: Rewrite of zsh-newuser-install
- Date: Mon, 5 Apr 2021 18:16:37 +0000
- Archived-at: <https://zsh.org/workers/48402>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2021-04/20210405181637.GA22397%40tarpaulin.shahaf.local2>
- In-reply-to: <CAHLkEDt+=qEL-jMqYxKBXBZuPEi_=dm-Ms-6oZY=b-RyjXJ2rw@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <B865F477-D72B-426F-9691-268C2E65EC85@dana.is> <EAEB39F8-6DEF-4BC0-A7E4-A59B16DBDF2F@gmail.com> <D2248BF1-5045-4F68-89F0-F92C903EF73D@dana.is> <20210225080519.GA22300@tarpaulin.shahaf.local2> <CAHLkEDtR6LCZy_2Ks-KATn9T3xyMmNh=ifxiHF4+KhO5uT-Cxw@mail.gmail.com> <20210227132121.GA9308@tarpaulin.shahaf.local2> <CAHLkEDt+=qEL-jMqYxKBXBZuPEi_=dm-Ms-6oZY=b-RyjXJ2rw@mail.gmail.com>
[ for skimmers: there's an unrelated question in the P.S.. ]
Marlon Richert wrote on Sat, Mar 20, 2021 at 00:12:28 +0200:
> Hi all! I pushed in another update:
> https://gitlab.com/marlonrichert/zsh-sensible/-/blob/master/zshrc
>
> I reorganized the entire .zshrc file in an effort to make it easier to
> read. I'd love to get your feedback.
>
> Also, I'm wondering: How do you plan to make a decision on moving
> forward with this? At which point are the new files good enough to
> replace the existing zsh-newuser-install?
Here's a quick review of zshrc and your version of zsh-newuser-install.
Haven't read the entire thread yet, so apologies if I'm repeating issues
previously raised.
Issues in the first-run wizard:
0. I recommend against reusing the name zsh-newuser-install for
a completely different thing. Names shouldn't be overloaded.
1. Errors from «mkdir ZDOTDIR» are discarded.
2. Uses of eval are unsafe (lack ${(q)}) and unnecessary.
3. That also applies to the munging of $template.
4. "$zshrc~" is silently overwritten
5. what happens if the exec on the last line fails?
6. Outputting `man zsh' in two different colours is confusing.
7. zsh's homepage is https://www.zsh.org/.
8. zrestart doesn't handle $ZDOTDIR.
9. For educational purposes, printing should use «print -r --» throughout.
10. Should zrestart use «exec»?
11. «print '\n'» prints _two_ newlines. That's too obscure for
educational code.
Issues in zshrc:
12. Some settings seems like they could break the principle of least
surprise: e.g., FLOW_CONTROL, NUMERIC_GLOB_SORT, matcher 'b:-=+',
check-for-changes (as opposed to check-for-staged-changes).
13. Recommend not to hide symbols from grep, as in up-line-or-{search,history}
14. Use of «bindkey -s … '^Q…'» seems questionable. As a way to inject
commands, it prints them to the tty and adds them to the history; that
doesn't seem elegant enough for example code that all new users would be
pointed to. It's also brittle in that it depends on ^Q not being
re-bindkey'd to anything else.
A few proposed additions:
15. hjkl bindings for menu selection:
if zmodload zsh/complist 2>/dev/null || (( ${+keymaps[(r)menuselect]} )); then
bindkey -M menuselect j down-line-or-history
bindkey -M menuselect k up-line-or-history
bindkey -M menuselect h backward-char
bindkey -M menuselect l forward-char
fi
17. Configure vcs_info to show the original patch's information during
rebases, etc.. It basically boils down to doing
«hook_com[applied-string]=$1» in a gen-applied-string hook. I posted
a fuller version in workers/47519 at the end.
18. Show how to use terminal colours/attributes other than the basic
ones. E.g., I use ${terminfo[dim]} in some places.
Cheers,
Daniel
P.S. I wonder if «: <->» should always behave as though
NUMERIC_GLOB_SORT is set. Haven't tried to nail down a complete
functional spec yet; just thinking out loud.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author