On Sun, Jul 12, 2015 at 06:52:35PM -0700, walt wrote:
> Maybe someone here has missed the recent discussion of zsh? ;)
> 
> I just found this website, giving a wonderful primer on how to
> configure zsh:
> 
> http://wiki.redbrick.dcu.ie/mw/Account_Customisation_(zsh)
> 
> Disclaimer:  I have no idea who they are, but I found this article very
> helpful indeed, and their advice Worked For Me.
> 
> In particular, I wanted to set my zsh command prompt to look like the
> custom bash prompt I've been using forever:
> 
> echo $PS1
> \u@\h:\w
> 
> Now here's the equivalent value in zsh:
> 
> echo $PS1
> %n@%M:%~
> 
> The most significant thing I just learned is that the zsh config name
> for its command prompt is PS1, the same as for bash.  (I needed help
> from the above-named website to get the details, but that was easy.)
> 
> I made the change to PS1 permanent by adding this familiar line to my
> ~/.zshrc:
> 
> export PS1="%n@%M:%~ "
> 
> Here is one interesting feature of zsh:  when I type e.g. 'les' and
> then hit Tab to invoke shell-completion, zsh shows me the usual
> suspects like less, lessecho, lesskey, etc.
> 
> But then if I continue to hit Tab multiple times, zsh actually changes
> the command prompt, rotating the possible commands through all the
> possible choices, and then I can just hit Return to execute my choice.
> 
> A minor feature, but clever, I think.

zsh can also auto-complete all sorts of things, including process list
for `kill' and `pkill', zfs datasets for the zfs and zpool commands...
you can even write your own completions for any command.

just wanted to point out, that the article got the "Adding colors to the
command prompt" part a little wrong. instead of using raw escape
sequences, zsh supports constructs like %F{red}, %F{green}, ... and %f.
you can read more about them in the zshmisc(1) manpage.

Attachment: signature.asc
Description: Digital signature

Reply via email to