Questions tagged [autocomplete]

A feature provided by interactive programs such as shells and text editors that inserts text to complete a word or phrase that the user is likely intending to compose.

A feature provided by interactive programs such as shells and text editors that inserts text to complete a word or phrase that the user is likely intending to compose.

818 questions
133
votes
9 answers

How do I get bash completion for command aliases?

I am looking to get tab-completion on my command line aliases, for example, say I defined the following alias : alias apt-inst='sudo aptitude install' Is there a way to get the completions provided by aptitude when I hit the tab key? i.e. when I…
levesque
  • 3,775
  • 5
  • 20
  • 15
118
votes
5 answers

Command-line completion from command history

So, I've looked at history and at Ctrl+R, but they are not what I thought I knew. Is there a way that I can type in the beginning of a command, and cycle through the matches in my history with some bash shortcut? # mysq(some shortcut key) Gives…
Ben Dauphinee
  • 1,283
  • 2
  • 9
  • 8
101
votes
3 answers

Rebuild auto-complete index (or whatever it's called) and binaries in $PATH cache in zsh

After installing new software, an already opened terminal with zsh won't know about the new commands and cannot generate auto-complete for those. Apparently opening a new terminal fix the problem, but can the index (or whatever you call it) be…
phunehehe
  • 20,030
  • 27
  • 99
  • 151
90
votes
2 answers

An easy bash completion tutorial?

I want to learn how to write bash completion scripts. Which tutorial would you recommend?
tshepang
  • 64,472
  • 86
  • 223
  • 290
88
votes
10 answers

Autocomplete server names for SSH and SCP

I have a few servers configured in ~/.ssh/config, such as alpha and beta. How might I configure Bash such that the commands $ ssh alTab and $ scp file.tgz alTab autocomplete the names of the configured servers? I don't want to add the servers to…
dotancohen
  • 15,494
  • 26
  • 80
  • 116
80
votes
4 answers

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

I find the beep useful for some things, so I only want to turn it off for tab completion (I'm not asking how to completely turn it off, that has already been answered in a different question on Serverfault). I also don't have root access, working on…
Shep
  • 991
  • 1
  • 8
  • 7
55
votes
2 answers

Terminal autocomplete: cycle through suggestions

I had this on my Ubuntu setup and since I switched to Fedora I want to set it and I forgot how... The idea is simple : I don't want the terminal to show me suggestions when I double tab, instead I want it to cycle through every possible suggestion…
vanjadjurdjevic
  • 797
  • 1
  • 10
  • 13
50
votes
3 answers

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

In Fish when you start typing, autocompletion automatically shows the first autocompleted guess on the line itself. In zsh you have to hit tab, and it shows the autocompletion below. Is there anyway to make zsh behave more like fish in this…
korylprince
  • 1,811
  • 2
  • 14
  • 12
47
votes
2 answers

How to combine zsh autocomplete for wrapper function arguments and existing command

I work mostly in gvim and many terminals. Originally, I preferred to open all my files in a single vim instance. To that end I used an alias to open files from my terminals in the current 'vim server'. alias rv="gvim --remote-silent" But having…
Justin C
  • 775
  • 5
  • 9
43
votes
4 answers

How to enable autocompletion for remote paths when using scp?

I remote copied a file to my laptop using: scp someFile [email protected]:/home/USER/put/it/some/where/oh/damn/you/here I want to be able to autocomplete the remote path by hitting tab.
k0pernikus
  • 14,853
  • 21
  • 58
  • 79
42
votes
6 answers

How to debug and fix slow autocomplete in bash?

After a recent update (Ubuntu 12.04 LTS), TAB complete on the command line is slow. After entering a partial command (e.g evi [TAB]) or partial filename (e.g. evince somedocu[TAB]) the shell, sometimes though not always, hangs for several…
Jan
  • 573
  • 1
  • 4
  • 7
42
votes
3 answers

Bash autocomplete: first list files then cycle through them

Is it possible to configure bash in such a way that on the first tab autocomplete it lists all possible files and on subsequent ones cycles through the choices? Both options are easy to do separately and I could bind them to different keys, but the…
Voo
  • 815
  • 1
  • 8
  • 14
41
votes
2 answers

How to specify a custom autocomplete for specific commands?

Is there a way to have bash know exactly what to display when you double tab? For example I have a python script scpy which requires a couple arguments. For example like apt-get, if you double tab gives you autoclean build-dep clean …
Falmarri
  • 12,897
  • 17
  • 58
  • 71
38
votes
6 answers

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

I am on Debian Jessie 8.6. I noticed that apt-get gets the expected bash autocompletion when pressing tab for packages and command, but when trying to use it with apt it does not work. I remember using xubuntu 16.04 where it worked, so I find it…
Andrea
  • 521
  • 1
  • 5
  • 5
38
votes
4 answers

Select an item in vim autocomplete list without inserting line break

A rather annoying feature of vim is that if you are in insert mode and do an autocomplete (Ctrl-N), arrow key down to the desired item, and press the Enter key, then it inserts the item but also inserts a newline which you then have to delete. Is…
Tyler Durden
  • 5,411
  • 16
  • 57
  • 96
1
2 3
54 55