How to autocomplete on KornShell command line using vi editor

On KornShell (ksh) on AIX UNIX Version 5.3 with the editor mode set to vi using:

set -o vi 

What are the key touches on the shell command line to autocomplete a file or directory name?

+7
unix shell vi ksh aix
source share
2 answers

ESC \ works at least on AIX4.2. One thing I noticed is that it only autocompletes the unique part of the file name.

So, if you have x.txt, x171go and x171stop files, the following will happen:

 Press keys: Command line is: xx <ESC>\ x 1 x1 <ESC>\ x171 g<ESC>\ x171go 
+12
source share

Extension of other answers: <ESC> * will display all relevant files on the command line. You can then use the standard vi editing commands to remove the ones you don't need. Therefore, to add to the above table:

 <ESC><shift-8> x.txt x171 x171go 

Then use the backspace to get rid of the last two, or press <ESC> again and use h or b to go back and dw to delete the ones you don't want.

+3
source share

All Articles