[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: path completion with cd <tab> - similar to tcsh

From: Peter Toft
Subject: Re: path completion with cd <tab> - similar to tcsh
Date: Fri, 15 Apr 2011 10:25:57 +0200
User-agent: Roundcube Webmail/0.5

On Fri, 15 Apr 2011 15:07:16 +0800, Clark J. Wang wrote:
On Fri, Apr 15, 2011 at 6:19 AM, Peter Toft <address@hidden> wrote:

Hi all

I have been using tcsh for a long time on Red Hat Linux boxes, and
bash on other UNIX-boxes. One thing I really love with tcsh is the way I can swiftly operate using the <TAB> to do auto-complete, when having
a deep directory hierarchy. I have that...

With bash I surely could use your skills to improve my usage of bash
(read; allow me to ditch tcsh fully).

I have an annoying bash-problem on Red Hat Linux 5.x. If I e.g. try to move to a subdirectory of another directory (e.g. $HOME), where the tab-expand
works poorly;

Assume $HOME=/home/pto

"cd $HOME<TAB>" is expanded to "cd /home/pto " (without the quotes).
I get $HOME expanded - quite ok - but I get an annoying space efter the
I will never like that space, I strongly prefer if I could get
"cd $HOME<TAB>" expanded to "cd /home/pto/" (without the quotes) so I could continue to press <TAB> and see the allowed sub-directories - much faster
for me.

I have also understood I can do
$ complete -o nospace  cd
to change the mode of operation, but this seems to disable the
function when doing cd $VARIABLE<TAB>.

I am guestimating, that you have discussed this in February
(cf. http://www.gossamer-threads.com/lists/gentoo/user/227574)
but the February archive seems to be lost;
so I cannot get the details of it.

That cited link is suggesting; "ESC ctrl-e gets rid of the
backslash, and if you want to keep the $VAR as $VAR, backspace over
the terminal space and continue. Or you can ESC ctrl-e again, and
convert the $VAR to its value, so you won't need to repeat the single
ESC ctrl-e for each further <tab>."
which IMHO is not really what I want.

Any hints on this? Can I set the mode of operation as I like where the
infamous space is replaced by a slash when doing "cd ... <TAB>"?


Peter Toft, PhD

That also annoys me much. Try like this:

$ complete -o default -o nospace -d cd
$ cd $VAR/<TAB>

well - with this I have to add the slash before the $VAR is expanded.
So - not quite there yet[1].


Peter [1] who is lazy :)

Peter Toft, PhD

reply via email to

[Prev in Thread] Current Thread [Next in Thread]