[KyOSS Discuss] zsh: best of bash, csh, and tcsh

Jeff Squyres jeff at squyres.com
Thu Jun 12 17:58:30 EDT 2014


I do know that zsh's tab completion behavior is highly configurable, but I
didn't look into it too closely.  Specifically, my impressions after
glancing through the tab completion customization stuff were:

   1. It looked like you could get tab completion to do whatever you want
   (probably even bash-like behavior)
   2. It looked like there was a bit of a learning curve to be able to
   tweak / play around with the tab completion stuff

That being said, one of my colleagues got all excited about zsh tab
completion behavior and, in a single day, he wrote tab completion
customization routines for one of the CLI commands in Open MPI:


https://svn.open-mpi.org/trac/ompi/browser/trunk/contrib/completion/mpirun.zsh

This wasn't trivial stuff, either.  One of the parameters to the "mpirun"
command in Open MPI is "--mca <variable> <value>", where <variable> is any
of Open MPI's internal run-time tunable variables.  He wrote the zsh code
such that when you type "mpirun --mca <tab>", it actually runs another Open
MPI command to list all possible variables (the "ompi_info" command) and
then do completion from that list.

Cool stuff...


On Thu, Jun 12, 2014 at 10:19 AM, Aaron VerDow <aaron at verdow.com> wrote:

> I really tried to love zsh but I absolutely hate the tab key behavior of
> cycling through the available options.  I loved some of the shell features
> but actually using it was so frustrating that I finally gave up.  If
> someone knows how to set it to only tab complete as far as it can go
> without guessing and then do nothing else I would switch back to zsh.   I
> looked around about a year ago when I first was messing with zsh but I
> could never get the tab key to behave like it did in bash.
>
>
> On Thu, Jun 12, 2014 at 9:48 AM, Deven Phillips <deven.phillips at gmail.com>
> wrote:
>
>> Nice! I have a bash prompt script which gives me the nice git integration
>> as well... It's one of my favorite recent discoveries. I wish I could have
>> made it to the meeting last night because I wanted to show off some of the
>> cool stuff I have been playing with recently (Vert.x, MoreUnit, etc..), but
>> I'm sure I will make it there again soon!
>>
>> Cheers,
>>
>> Deven
>>
>>
>> On Thu, Jun 12, 2014 at 8:13 AM, Jeff Squyres <jeff at squyres.com> wrote:
>>
>>> Last night, I showed about 5 minutes of zsh.  zsh is basically the best
>>> things you like about bash, csh, and tcsh all rolled into one.  zsh is part
>>> of most major distros these days -- it's even part of OS X:
>>>
>>>     http://www.zsh.org/
>>>
>>> I also use "zprezto" -- a set of macros and plugins for zsh that
>>> instantly makes zsh 38% more awesome:
>>>
>>>      https://github.com/sorin-ionescu/prezto
>>>
>>> This gives me stuff like the git branch and icons that you saw last
>>> night when I cd into a directory that is a git clone.  For example:
>>>
>>> -----
>>> [8:10] JSQUYRES-M-504A:~ ❯❯❯ cd git/cisco/ompi-usnic
>>> [8:11] JSQUYRES-M-504A:~/g/c/ompi-usnic git:usnic-v1.6 ❯❯❯ git checkout
>>> usnic-v1.8
>>> Checking out files: 100% (7456/7456), done.
>>> Branch usnic-v1.8 set up to track remote branch usnic-v1.8 from origin.
>>> Switched to a new branch 'usnic-v1.8'
>>> [8:11] JSQUYRES-M-504A:~/g/c/ompi-usnic git:usnic-v1.8 ❯❯❯
>>> -----
>>>
>>> ​Note that the prompt changed automatically a) when I cd'ed into the
>>> tree, and b) when I checked out a different branch.​
>>>
>>> I also love the abbreviated directory that it puts in my prompt -- it
>>> shortens each subdir up to the current directory to just 1 letter.  So it
>>> still gives you a visual cue of how far away from ~ I am, but it doesn't
>>> necessarily represent the full path length.
>>>
>>> ​zsh+zprezto is yummy.
>>>
>>> --
>>> {+} Jeff Squyres
>>>
>>> _______________________________________________
>>> KyOSS-Discuss mailing list
>>> KyOSS-Discuss at kyoss.org
>>> Subscribe by sending email to kyoss-discuss-subscribe at kyoss.org
>>> Unsubscribe by sending email (from the address you wish to unsubscribe)
>>> to kyoss-discuss-unsubscribe at kyoss.org
>>> Difficulty unsubscribing? Check your email headers for originally-to
>>> address in case you are forwarding your mail.
>>> More options at http://kyoss.org/cgi-bin/mailman/listinfo/kyoss-discuss
>>>
>>
>>
>> _______________________________________________
>> KyOSS-Discuss mailing list
>> KyOSS-Discuss at kyoss.org
>> Subscribe by sending email to kyoss-discuss-subscribe at kyoss.org
>> Unsubscribe by sending email (from the address you wish to unsubscribe)
>> to kyoss-discuss-unsubscribe at kyoss.org
>> Difficulty unsubscribing? Check your email headers for originally-to
>> address in case you are forwarding your mail.
>> More options at http://kyoss.org/cgi-bin/mailman/listinfo/kyoss-discuss
>>
>
>
> _______________________________________________
> KyOSS-Discuss mailing list
> KyOSS-Discuss at kyoss.org
> Subscribe by sending email to kyoss-discuss-subscribe at kyoss.org
> Unsubscribe by sending email (from the address you wish to unsubscribe) to
> kyoss-discuss-unsubscribe at kyoss.org
> Difficulty unsubscribing? Check your email headers for originally-to
> address in case you are forwarding your mail.
> More options at http://kyoss.org/cgi-bin/mailman/listinfo/kyoss-discuss
>



-- 
{+} Jeff Squyres
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://kyoss.org/pipermail/kyoss-discuss/attachments/20140612/ac5fc102/attachment.html>


More information about the KyOSS-Discuss mailing list