0

I would like to use an interactive posix bash shell but the autocompletion feature doesn't work. When i type the tab character it simply prints a tab. The tab completion only works when i'm on a non posix interactive shell or on a posix interactive shell with emacs input mode. I find emacs input mode very awkward and i am used to vi input mode. The problem only arises when i am on posix mode and vi input mode in which case the tab key only prints a tab space on my shell. Also, the same problem arises when i invoke bash with the sh command.

Here is my /etc/inputrc :

# do not bell on tab-completion
set bell-style audible

set meta-flag on
set input-meta on
set convert-meta off
set output-meta on

# Completed names which are symbolic links to
# directories have a slash appended.
set mark-symlinked-directories on

set editing-mode vi
set keymap vi-insert
set mark-modified-lines on

$if mode=emacs

# for linux console and RH/Debian xterm
"\e[1~": beginning-of-line
"\e[4~": end-of-line
# commented out keymappings for pgup/pgdown to reach begin/end of history
#"\e[5~": beginning-of-history
#"\e[6~": end-of-history
"\e[5~": history-search-backward
"\e[6~": history-search-forward
"\e[3~": delete-char
"\e[2~": quoted-insert
"\e[5C": forward-word
"\e[5D": backward-word
"\e[1;5C": forward-word
"\e[1;5D": backward-word

# for rxvt
"\e[8~": end-of-line
"\eOc": forward-word
"\eOd": backward-word

# for non RH/Debian xterm, can't hurt for RH/DEbian xterm
"\eOH": beginning-of-line
"\eOF": end-of-line

# for freebsd console
"\e[H": beginning-of-line
"\e[F": end-of-line
$endif
neoprout
  • 61
  • 4
  • Please don't cross-post the same question on multiple stack exchange sites. This can result in situations like this one where your (identical) question was migrated from [so] to us and [now appears twice](http://unix.stackexchange.com/q/132135/22222) here. – terdon May 27 '14 at 15:48

1 Answers1

0

You'll need to explicitly enable tab completion for vi mode with

"\C-i": complete

in .inputrc. Note there is also an (undocumented?) vi-complete command that might be more suitable for vi mode.

chepner
  • 7,341
  • 1
  • 26
  • 27