101 votes

How do I get bash completion for command aliases?

Try complete-alias, which solves this problem exactly. (Disclaimer: I am the author of complete_alias) After install it you can use one generic function to complete many aliases like this: complete -...
Cyker's user avatar
  • 4,274
68 votes
Accepted

zsh: command not found: {compinstall,compinit,compdef}

This is the same issue I got on my mac. I am using zsh shell. Compdef is basically a function used by zsh for load the auto-completions. The completion system needs to be activated. If you’re using ...
GOPESH CHAUDHARY's user avatar
41 votes

Debian - apt (not apt-get) autocompletion not working

Debian does not come with 'bash-completion' installed and enabled. If you're coming to Debian from, say, an Ubuntu background, where it is pre-installed and enabled by default, this can be a source of ...
Wyatt Ward's user avatar
  • 4,032
30 votes

How can I configure zsh completion to show hidden files and folders?

This is a zsh option. It is mentioned in its introduction. GLOBDOTS lets files beginning with a . be matched without explicitly specifying the dot. Add the following to your .zshrc file. setopt ...
Bluu's user avatar
  • 409
29 votes
Accepted

Add trailing slash in bash completion of directory symbolic links

Add the following line to your ~/.inputrc file: set mark-symlinked-directories on See "Readline Init File Syntax" in the Bash Reference Manual for more on this topic.
Warren Young's user avatar
28 votes

How to turn off the beep only in bash tab-complete

If you don't want to create and maintain a separate ~/.inputrc file, you can also just add this line to ~/.bashrc: bind 'set bell-style none' Then source ~/.bashrc to reload it.
wisbucky's user avatar
  • 3,368
27 votes
Accepted

Can I navigate zsh's tab-completion menu with vi-like hjkl keys?

Yes, you can by enabling menu select: zstyle ':completion:*' menu select zmodload zsh/complist ... # use the vi navigation keys in menu completion bindkey -M menuselect 'h' vi-backward-char bindkey -...
jasonwryan's user avatar
23 votes
Accepted

Is it possible to configure bash to autocomplete with one tab like zsh?

Put this in your ~/.inputrc: set show-all-if-ambiguous on For additional credit, add: set completion-ignore-case on All of the options are in the GNU manual...
jasonwryan's user avatar
22 votes

Bash autocomplete: first list files then cycle through them

This is what I use. As far as I can tell it does exactly what you want. # make tab cycle through commands after listing bind '"\t":menu-complete' bind "set show-all-if-ambiguous on" bind "set ...
Milo's user avatar
  • 321
19 votes

How do I get bash completion for command aliases?

By googling this issue I ended up here, so I tried the approaches in the other answers. For various reasons I don't actually understand, they never behaved properly in my Ubuntu 16.04. What in the end ...
M.Ermatinger's user avatar
19 votes
Accepted

How can I configure zsh completion to show hidden files and folders?

You could add globdots to $_comp_options in your .zshrc e.g. ..... compinit _comp_options+=(globdots) .....
don_crissti's user avatar
  • 82.7k
16 votes

How to specify a custom autocomplete for specific commands?

Here is basic guide. Lets have an example of script called admin.sh to which you would like to have autocomplete working. #!/usr/bin/bash while [ $# -gt 0 ]; do arg=$1 case $arg in option_1) ...
Eduardo Cuomo's user avatar
16 votes
Accepted

Hide some commands from bash completion?

This is rather new, but in Bash 4.4 you can set the EXECIGNORE variable: aa. New variable: EXECIGNORE; a colon-separate list of patterns that will cause matching filenames to be ignored when ...
zuazo's user avatar
  • 3,042
16 votes

zsh: command not found: {compinstall,compinit,compdef}

Answer to the question as asked Access these commands by running: $ autoload -Uz compinstall && compinstall It will load a guided wizard, I quit as soon as I had the option to Save and exit....
Tom Hale's user avatar
  • 30.4k
16 votes
Accepted

Where to install bash completion scripts for out of tree packages?

From what I could gather after a lot of reading, specially their official documentation, /usr/share/doc/bash-completion/README.Debian, and the sources themselves: /etc/bash_completion.d/ is the ...
MestreLion's user avatar
  • 1,418
16 votes
Accepted

Prevent completion of files for 'make' command in zsh shell

You can ask zsh to only display targets tag for the make command completion with zstyle ':completion:*:*:make:*' tag-order 'targets' Add above code somewhere after the line autoload -U compinit &...
jimmij's user avatar
  • 47.1k
15 votes
Accepted

sudo: nocorrect: command not found

I have this alias alias sudo='sudo 'defined in a file which I sourced at the end of ~/.zshrc file which overwrote alias sudo='nocorrect sudo' which is defined in .oh-my-zsh/lib/correction.zsh alias ...
Alex Jones's user avatar
  • 6,353
14 votes
Accepted

Automatically add slash when navigating through symlink

Set the mark-symlinked-directories readline option. The usual way to do this is to edit ~/.inputrc, put set mark-symlinked-directories on in there, then start a new bash shell (or press Ctrl+X Ctrl+...
Mikel's user avatar
  • 57.3k
14 votes

Is it possible to configure bash to autocomplete with one tab like zsh?

I do not have enough reputation to comment, but I would add to jasonwryans answers that it can be added to .bash_profile or .bashrc by writing them as: bind 'set show-all-if-ambiguous on' bind 'set ...
Thomas Jansson's user avatar
14 votes
Accepted

Where does SSH pull autocompletion from?

The OpenSSH is using bash completion from package bash-completion. The responsible script is stored in /usr/share/bash-completion/completions/ssh (on Fedora. Might be different on different distros). ...
Jakuje's user avatar
  • 21.3k
14 votes

debugging zsh completion method

Press ^X? (Ctrl+X ?) instead of Tab to run _complete_debug. This places a trace of the completion code into a file which you can view by pressing Up Enter. Alternatively, if you want to generate a ...
Gilles 'SO- stop being evil''s user avatar
13 votes

Terminal autocomplete: cycle through suggestions

You can cycle through the completion menu in Bash, and you can also show the menu of items. Unlike in Zsh, the current menu item will not be highlighted. Add to ~/.inputrc: set show-all-if-ambiguous ...
gmarmstrong's user avatar
  • 1,233
13 votes

Select an item in vim autocomplete list without inserting line break

Personally I use this one: inoremap <expr> <TAB> pumvisible() ? "\<C-y>" : "\<CR>" inoremap <expr> <Esc> pumvisible() ? "\<C-e>" : "\<Esc>" inoremap &...
Dmitrii's user avatar
  • 231
13 votes

Autocompletion fails on <TAB> with `bash: !ref: unbound variable`

The problem was fixed after command $ set +u
Oleg Svechkarenko's user avatar
12 votes
Accepted

Bash completion is very incomplete on centos 7

You might want to try bash-completion-extras. It was briefly only in epel-testing, but has been released into epel. Right now, you should be able to run: yum --enablerepo=epel install bash-...
jsbillings's user avatar
  • 24.4k
11 votes

How to make zsh completion show the first guess on the same line (like fish's)?

Follow the steps here to get other features as well: https://github.com/abhigenie92/zsh_to_fish Install oh-my-zsh sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/...
Abhishek Bhatia's user avatar
11 votes

Autocomplete server names for SSH and SCP

To enable ssh autocompletion in Debian and Ubuntu: sudo apt-get install bash-completion Note that this has nothing at all to do with known_hosts hashing, contrary to what was stated above and the ...
fatal_error's user avatar
11 votes
Accepted

Search bash history for already typed command

If you start typing a command and then, after typing some of it, remember to do a history search, you just need to: CTRL+A CTRL+R CTRL+Y CTRL+R ... (keep searching or) CTRL+S ... (search in the other ...
DrBeco's user avatar
  • 774
11 votes

How to enable bash completion in vi mode on Synology DSM6

TL;DR Solve by creating ~/.profile with if [ $0 != -bash ]; then exec -l bash fi Long version: After searching for quite a while I found that on DSM6 bash runs in posix mode (verify with set -o) ...
Gerhard Burger's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible