Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Rewrite of zsh-newuser-install (Mikael's subthread)



On Mon, Apr 5, 2021 at 12:44 PM Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
>
> > # Prompt settings
>
> This is 70 lines that should be a prompt theme, not pasted verbatim in .zshrc.

There was some side discussion about prompt themes being unmaintained
and therefore unsuitable for this.  My take is that we should find a
way to put some effort into maintaining it.  We did just have a few
patches for it, so I personally would be fine with this going into a
theme.

> > typeset -A key  # Declare `$key` table, without overriding any existing values.
>
> How could $key possibly already exist as an associative array at this
> point?

Also, won't this by default print everything that's already in $key if
by some magic (/etc/zsh* or ~/.zshenv ?) it does already exist?

> > WORDCHARS=''  # Characters treated as part of words (in addition to letters & numbers)
>
> Why are we setting WORDCHARS to the empty string here?

There was a side discussion about this, too.  The default WORDCHARS
acts like the stty driver, emptying it works more like emacs.

> > bindkey -M menuselect "$key[PageUp]"   backward-word          # Page Up
> > bindkey -M menuselect "$key[PageDown]" forward-word           # Page Down
>
> I think most people expect these keys to scroll history backward/forwards.

I don't recall what difference being in the menuselect keymap makes here.

> > bindkey -s '^[-' "^Qpushd -1$key[Return]"   # Alt-Minus:  Back to previous dir stack entry.
> > bindkey -s '^[=' "^Qpushd +0$key[Return]"   # Alt-Equals: Forward to next dir stack entry.
>
> Might go as far as say NAK on these bindkey -s abominations.

Yeurgh.  Agree, avoid bindkey -s.

> > # Make each entry in these Unique (that is, remove duplicates).
> > # See http://zsh.sourceforge.net/Doc/Release/Shell-Builtin-Commands.html#index-typeset
> > typeset -gU PATH path FPATH fpath CDPATH cdpath MANPATH manpath
>
> specifying the scalar halves of these tied variables is superfluous.

Again, previously discussed ... the man page recommends specifying
both halves because of the -U option.

> Overall I think there's a bit too much stuff in here. It's longer than
> some (many) actual personal .zshrc files I've seen.

I tend to agree.




Messages sorted by: Reverse Date, Date, Thread, Author