Tab autocompletion and history in tcsh

autocompletecommand historytcsh

I use tcsh, and I'd like to set up the following behaviour, which I've seen on some systems in the past. If I type

!string TAB

then:

  • If the history contains a unique entry beginning with string, autocompletion should take place, and I can edit the resulting command, or just press return to execute it.

  • If the history contains multiple entries beginning with string, a list of possible completions is displayed, the command is partially completed as far as possible (without eliminating any possibilities from the list), and on the command line I should have an exclamation mark followed by the partially completed command, so that I can type more characters and press TAB again.

How do I achieve this?

Best Answer

Add

set autoexpand

to .tcshrc to activate this feature.

Related Question