2
1
In a shell that implements GNU Readline, I can click the key to get a list of possible completions to what I started typing. For example:
C:\>cd P<TAB>
PerfLogs\ Program Files (x86)\ Python27\
Program Files\ ProgramData\
How can I now choose which completion I wish to use?
I know that If I want "Program Files" in the above example, I can type in "rogram Files", but I'm lazy :).
Isn't there some way for me to hit a keyboard shortcut that will iterate through the possible completions so I can quickly choose one? Something similar to auto-completion / intellisense in modern IDEs?
Edit: Might my solution be to use GNU Readline's menu-complete
command (described below)? But how do I bind it to a key combination?
menu-complete ()
Similar to complete, but replaces the word to be completed with a single match
from the list of possible completions. Repeated execution of menu-complete steps
through the list of possible completions, inserting each match in turn. At the end of
the list of completions, the bell is rung (subject to the setting of bell-style) and
the original text is restored. An argument of n moves n positions forward in the list
of matches; a negative argument may be used to move backward through the list. This
command is intended to be bound to TAB, but is unbound by default.
1You could just continue by typing
r
Tab
(which will complete toProgram
) and then\
Tab
to get toProgram Files
. The\
might be annoying to represent a single space, which is related to the convention to avoid spaces in file names in general. In this case it would in total be six keystrokes to reachProgram Files
:Pr
Tab
\
Tab
. I'm testing this in Bash; you are obviously on a Windows system, though, but I would guess it works in the same way there. I don't know how to enable "intellisense" like completion. – Daniel Andersson – 2013-08-03T14:05:43.300@DanielAndersson Windows tab-complete works differently; each
Tab
gives you a different option, unlike bash, which requires you to input another character to narrow it down – nc4pk – 2013-08-03T14:11:37.197