4
I’m a long time tcsh user, but all the cool kids seem to be using either bash or zsh nowadays (that is, completion patterns for git or stuff are available for bash and zsh, rarely for tcsh).
My problem is that both shells have behaviours regarding tab-completion of paths that drive me crazy, and I’m having much trouble finding how to change them to my liking.
Here’s a couple of examples of what I’m used to doing in tcsh that the others do differently:
/u<TAB>
completes to/usr/
- Then tab lists the contents of
/usr/
/usr/li<TAB>
completes to/usr/lib
and listslib/
andlibexec/
- Pressing tab a second time completes to
/usr/lib/
- Pressing tab a third time lists the contents of
/usr/lib/
In bash, no matter how many times I hit tab, it will never go past /usr/lib
, requiring me to type the slash, which I don’t want to do.
In zsh, /usr/li<TAB>
first completes to /usr/lib
, then another tab lists lib/
and libexec/
, a third time tab completes to /usr/lib/
, and all subsequent tabs cycle between /usr/lib/
and /usr/libexec/
. I have no idea how to get past this point. I just want to go from /usr/li
to /usr/lib
, then /usr/lib/
, then list its contents.
Same goes for python. In tcsh, I type pyt<TAB>
, it completes to python
and lists python
, python2.5
, python2.6
, etc, then a second tab settles for python and add the space. In bash it requires me to type the space and in zsh it cycles endlessly like in the first example.
Any help in taming these shells would be greatly appreciated. I don’t really want to spend time tweaking the other aspects of these shells until I solve the problem above.
Part of learning a new environment is getting used to how it works.
man bash
/completion
– Ignacio Vazquez-Abrams – 2011-05-05T13:38:47.387I can’t help but think that this comment is both condescending and suggesting that I adapt to how bash works. Please correct me if I’m wrong, I’d love to. – Olivier 'Ölbaum' Scherler – 2011-05-07T23:41:31.527
It's not meant to be condescending, but it is an inevitable fact that different software likely has slightly different features. – Ignacio Vazquez-Abrams – 2011-05-07T23:44:00.660
Hence my asking, because me not finding a way to do something does not necessarily mean that it cannot be done. :) Like the
rec_exact
option suggested below for zsh: it does exactly what I want, but I don't remember it popping up in my searches, and even if it did, I'm not sure I'd have understood that it was what I was looking for. – Olivier 'Ölbaum' Scherler – 2011-05-09T08:34:02.717