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

Re: Rewrite of zsh-newuser-install



Generally speaking not bad.  Thanks for the sample.  More detailed commentary:

> HISTFILE=${ZDOTDIR:-$HOME}/.zsh_history # File in which to save history

I've seen/used this as ".zhistory" for decades, but that's not
actually coded anywhere except in the "c2z" example, I guess.  I find
the underscore annoying since none of the other startup files have
one, though I understand the objection to doubling the "h".

> setopt HIST_IGNORE_ALL_DUPS # Ensure all history items are unique.

I'd go with just HIST_IGNORE_DUPS rather than ALL, and as for these:

> setopt HIST_REDUCE_BLANKS   # Remove insignificant whitespace.
> setopt SHARE_HISTORY        # All simultaneous sessions use the same history.

I agree with Lawrence, these are too intrusive.  SHARE_HISTORY makes
me crazy unless some sort of directory-local-history is also in use,
especially if the home directory is NFS mounted or the like.

A bunch of stuff about prompts:

Prompt colors are going to be a matter of taste; if you're going to
apply them then you have to pick a color scheme that's visible on
either a light or a dark background, since zsh doesn't control that
terminal state.  I have a white background and the yellow text in RPS2
is almost unreadable.

%F{8} and %F{12} do nothing on my terminal (ssh in Terminal.app from
Mac to Ubuntu, in this case), they just emit the same as %F{default},
so I don't know what you're after with those.  Don't use numerics.

I don't like the leading blank line in the prompt, either, but it's
not a showstopper.  Isn't coloring the prompt sufficient visual
differentiation?

I don't have a strong opinion about the PS4 prompt, but here's mine:
PS4=": %1N:%i%1(_.:%_.); "
This makes the prompt string into a ":" command ending at ";" so most
of the time you can copy-paste the PS4 output directly back to the PS1
input and hit enter to run it.  Same trick used in $HISTFILE for
extended history.  Putting extra newlines and characters like ">" in
PS4 make that impossible.

RE completion styles:

Again with the %F{8}, just to call it out.  Mostly good otherwise,
just some random grumbling:

In the completer style, _history with 12000 lines of context does not
give me warm fuzzies.

In matcher-list, I waver back and forth on using [:punct:] instead of
something more specific like [-_,.] (which is what I've used for
years).

I'm not a fan of the case-insensitive sorting attempt.

> unsetopt AUTO_PARAM_SLASH # Don't add trailing slashes to dir completions.

Why?   The comment isn't very clear either, since it's not "dir
completions" it's $foo where the expansion of $foo gives the name of a
directory.  It seems weird to do this when later on you have

> setopt AUTO_NAME_DIRS

which I would recommend against (although not strongly).

RE key bindings/line-init:

Wasn't there a sidebar into why terminfo isn't trustworthy?  In any
case, application mode is exactly the opposite of how I want my shell
behaving, unless I'm misinterpreting your code.

Don't mess with Ctrl-U.

I'm not sure I like your choices for Enter / Alt-Enter in menuselect,
because it seems to presume that the most common case is to do
menu-selection on the last word being entered for a command ... but my
experience is that I'm more often using menu-selection on the set of
command-line options, which typically have to be followed by
additional arguments.




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