bug-bash
[Top][All Lists]
Advanced

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

Re: Circulate matches in command completion?


From: Peng Yu
Subject: Re: Circulate matches in command completion?
Date: Fri, 12 Feb 2010 17:14:28 +1800

On Fri, Feb 12, 2010 at 1:36 PM, DennisW <address@hidden> wrote:
> On Feb 11, 11:33 am, Peng Yu <address@hidden> wrote:
>> On Thu, Feb 11, 2010 at 10:36 AM, Chet Ramey <address@hidden> wrote:
>> > On 2/11/10 11:05 AM, Peng Yu wrote:
>> >> On Thu, Feb 11, 2010 at 9:58 AM, Chet Ramey <address@hidden> wrote:
>> >>> On 2/11/10 10:54 AM, Peng Yu wrote:
>> >>>> Suppose I file 'a1.txt' and 'a2.txt' in my current directory. When I
>> >>>> type 'cat a' then TAB, it will show me 'a1.txt' and 'a2.txt'. If I
>> >>>> type TAB repeatedly, it will always show me the same thing.
>>
>> >>>> However, a better response might be
>> >>>> 1. complete the command to 'cat a1.txt' at the 2nd TAB,
>> >>>> 2. complete the command to 'cat a2.txt' at the 3rd TAB,
>> >>>> 3. return to the original 'cat a' at the 4th TAB,
>> >>>> 4. complete the command to 'cat a1.txt' again at the 5th TAB.
>>
>> >>>> I'm wondering if there is a way to configure bash this way.
>>
>> >>> bind 'TAB:menu-complete'
>>
>> >> This is helpful. But it is not exactly what I'm looking for. I still
>> >> want to show 'a1.txt' and 'a2.txt' at the 1st TAB. The above bind
>> >> command gives me 'cat a1.txt' directly at the 1st TAB.
>>
>> > Look at the 'show-all-if-ambiguous' option.  The combination may do what
>> > you want.
>>
>> set show-all-if-ambiguous On
>> bind 'TAB:menu-complete'
>>
>> I typed in the above two commands. It seems that command completion is
>> the same as if I only typed in the second command. Do you know why?
>
> The first command should be:
>
> bind 'set show-all-if-ambiguous On'

bind 'set show-all-if-ambiguous On'
bind 'TAB:menu-complete'

I typed the above commands in the command line, but I still don't see
the print out of all matches. Would you please let me know how to
debug what is wrong?




reply via email to

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