bug-bash
[Top][All Lists]
Advanced

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

Re: filename completion suggestions


From: Chet Ramey
Subject: Re: filename completion suggestions
Date: Thu, 7 Dec 2000 13:34:44 -0500

> > The prompt is only presented if you exceed the default limit of 100
> > possible completions.  You can set the readline variable
> > `completion-query-items' to a larger value.
> 
> I'm saying I want a second tab to be an equivalent to a 'y' in the default
> setup.

That's rarely what's wanted.  Set completion-query-items to something like
32768.  It's as simple as putting

set completion-query-items 32768

into ~/.inputrc.

> > > environment variables could optionally be part of expansion candidates
> > > LS_<TAB>  should expand to LS_COLORS=
> >
> > Bash has a variable completion function bound to M-$ in emacs mode.
> 
> [grasping for questions to show that I'm smart:] Ok, but what if one wants
> TAB to do both jobs?

One could write a shell function and bind it to particular commands with
the programmable completion mechansims.  For example,

complete -v export local readonly

tells readline that export, local, and readonly complete shell variable
names.  Look at the scripts in examples/complete and the Programmable
Completion section of the manual page (in the READLINE section).

There's currently no way to replace the default completion mechanisms with
programmable completion functions, though.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet)

Chet Ramey, CWRU    chet@po.CWRU.Edu    http://cnswww.cns.cwru.edu/~chet/



reply via email to

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