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.

learn more… | top users | synonyms (2)

3
votes
3answers
3k views

Bash Auto-Completion feature for SSHing into Different Hosts

I have big list of servers which I normally ssh to all the time. Is there any way using bash or zsh so that I can keep the list of hostname and bash auto-completion goes through the file and gives me ...
3
votes
1answer
243 views

Bash remote autocompletion : change the 'starting' directory

I'm regularly downloading files from a remote server, always from the same directory. So I wrote a custom function that I put in my bashrc: download_from_myserver () { for file in "$@" do ...
0
votes
2answers
370 views

TAB autocomplete on sudo sh

When I say sudo sh, TAB stops working as autocomplete signal on my Debian. How can I enable TAB key autocomplete after I say sudo sh ?
3
votes
2answers
687 views

How to enable tab completion of wildcards in bash?

How can I enable tab completion in bash for a statement such as vim db/migrate/*crea? Essentially I am looking for tab completion to match the regular expression and present the options. How would ...
3
votes
2answers
285 views

How do I let bash autocomplete wildcards?

If I have directory containing the files foo.bar.a.cat foo.bar.a.hat and I type ls f+TAB the bash shell autocompletes to ls foo.bar.a.. If I type ls *bar*+ TAB I would like it to autocomplete to ...
4
votes
1answer
406 views

Tab completion doesn't work for arguments when command is an alias

I have an alias, ee, defined for my favorite editor, mg. When I do something like mg fo and then hit tab, if a file foo exists, I get tab completion to: mg foo On most systems I use (e.g., all ...
3
votes
1answer
80 views

Ignore files for zsh's completion for SVN

I managed to configure zsh such that it does not suggest LaTeX temporary files when I use autocompletion for emacs by adding this line to my ~/.zshrc: zstyle ':completion:*:*:emacs:*:*files' ...
6
votes
2answers
875 views

How to implement package install suggestion on Debian?

I have noticed that while on Ubuntu, if I type the following: mc and it isnt installed, I get the message below: The program 'mc' is currently not installed. You can install it by typing: sudo ...
1
vote
1answer
81 views

Set auto completion for a new filetype

I have a file, which contains lines of function name, now I want to use them for code auto completion, and only for file names end with .XXX. How should I do it, is it possible to work with ctags or ...
4
votes
3answers
2k views

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 ...
18
votes
4answers
5k views

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 ...
0
votes
1answer
167 views

Why is vim offering me spelling suggestions instead of using the completefunc?

I am trying to set up vim for writing email. I have a plugin to provide autocompletion of email addresses (notmuch abook ). If I do :set completefunc it tells me it is CompleteAddressBook as ...
3
votes
1answer
50 views

Is there an easy way to change bash suggestions?

I've noticed that some console commands (like sudo or xargs) are using different kind of suggestions when I press Tab (they suggest programs instead of files). Is there a way to mimic that kind of ...
1
vote
1answer
73 views

Directory stack order in zsh

I am working on Zsh 5.0.2 (latest stable version), and I noticed that: dirs -v and cd -<TAB> show a different list of directories (or at least directories in different order). Moreover, ...
2
votes
1answer
140 views

Autocompletion of email addresses in vim

I'm playing around with various bits of an email solution, including notmuch and alot. I write my emails in vim and I'd like to have tab completion of email addresses while writing email. Is there a ...
4
votes
4answers
124 views

Bash-completion and grep

I installed a program (iftop) on Debian Squeeze but some days ago I forgot it's name. I had only this information about the program: 1) It was called *top 2) I could find it using bash-completions. ...
3
votes
2answers
2k views

Disable bash tab completion

Is it possible to disable bash's autocomplete on pressing tab? The reason I want to do this is that I often paste code from an editor where I use the tab character instead of a number of spaces for ...
4
votes
2answers
71 views

Check argument before program run

I have noticed that, when I type unzip in bash and press tab, auto-complete works only on files with .zip extension. How is that done? What if I would like to make program that would accept only image ...
2
votes
2answers
85 views

Expand less-than sign when using multios and brace expand

With zsh multios set (setopt multios) it's possible to do things like: < in1 < in2 > out and: < in > out1 > out2 which is very convenient. I want to combine this feature with ...
0
votes
1answer
132 views

Vim - Tabs in :o Show up as ^I and Autocomplete Does Not Function

The title basically says it all - in Vim, my tab's show up as ^I, and I'm wondering if anybody knows why this might be. This is especially annoying when using :o to open a file, as the autocomplete ...
1
vote
1answer
116 views

zsh completion: getting file names from a specific directory

OK, a little background: I use a Mac, and I do as much as possible in the CLI. In particular, I frequently pop in a USB stick, cp or mv a file over, and then immediately wish to eject (unmount and ...
4
votes
1answer
164 views

Restore default completion

I use compgen when $COMP_WORD equals 1, now I want to restore default completion when otherwise, Right now I have, _rr() { case $COMP_CWORD in 1) COMPREPLY=($(compgen -W "A ...
1
vote
1answer
348 views

bash autocomplete not working, does not 'complete'

I my bashrc. I have a bash completion for the command scp implemented as follows function _scp_complete { COMPREPLY="" COMPREPLY+=( $(cat ~/.ssh_complete ) ) COMPREPLY+=( $( find . ! -name . ...
2
votes
1answer
92 views

zsh autocompletion for symlinks

Say I have a folder parent with a subfolder, subfolder and a symbolic link symbolic_link. I noticed that if my current working directory subfolder and I try to do cd ../sym[TAB], it will not ...
11
votes
3answers
2k views

How can I tell bash valid tab-completions for arguments to my Python script

Say I have a program hello.py and one possible valid argument to it is: ./hello.py autoawesomesauce Is is possible to type in: ./hello.py auto[tab] at which point the partially completed ...
12
votes
1answer
526 views

Dynamically update completion list in zsh

I find zsh's result lists for Tab completion quite useful, however I'd like to tweak their behaviour a bit: They should appear when I Tab for the first time and afterwards dynamically update with ...
10
votes
1answer
362 views

Bash tab completion expands “~” into “/home/___” when it didn't before

Previously, if I typed ~/biTab, before, it would turn into ~/bin. However, today it started turning ~/biTab into /home/username/bin. I would rather have it the former, but I'm not sure what happened ...
4
votes
3answers
131 views

Can any shell do argument-level interactive search?

Sometimes I need to reuse certain long arguments like paths. If I use history search (CTRL+R), I may find some command that contains the path, but I still need to delete anything else in the old ...
3
votes
4answers
1k views

List all files / binaries in current PATH

Is there an "easy" way of running an "ls -la" style command for listing all files / executable binaries in the current PATH? (I intend to pipe the output into grep, for looking for commands with ...
3
votes
1answer
108 views

zsh refusing to accept new autocomplete script

I have a software project that I'm attempting to write zsh completions for. After installing a package that provided a number of pre-made completions, I found they were put here: ...
1
vote
1answer
223 views

How can one provide colour to tab completion in tcsh?

(Crossposted from StackOverflow.com) This question and the answer teach us how to introduce colour into tcsh prompts. This webpage explains nicely how to get colour into any output of the echo ...
2
votes
3answers
503 views

How to append / extend zshell completions?

I am using zsh with oh-my-zsh. Unfortunately, oh-my-zsh does not use file ~/.ssh/config for hostname auto-completion (see Issue #1009, for instance). This could easily archived by the following code: ...
2
votes
1answer
667 views

Avoid a trailing slash in bash when completing a directory name (like zsh)

I'm on a Mac and the cp and mv commands are killing me due to them copying the contents of a directory if a trailing slash is present. It has bitten me more than once when I use tab completion to ...
5
votes
4answers
5k views

Apt-get autocompletion

I am currently running 64-bit Debian Wheezy. I am having some trouble with auto completion for apt-get. I have bash-completion installed. If I am logged in as root in a shell, I can use auto ...
2
votes
1answer
170 views

Stop tab completion suggesting 'messagebus'

I've got a directory called build, which I cd into quite a bit. If there isn't any directory bu* in the current directory, zsh tab completion: cd buTAB suggests messagebus/, which isn't in .. If I ...
3
votes
2answers
2k views

Tab autocompletion and history in tcsh

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, ...
1
vote
3answers
299 views

VIM only files, cd only directories

When using Tab for completion on the Bash shell prompt, is there any way to configure it to complete only files for the command vim and only directories for the command cd? In large directories with ...
17
votes
1answer
3k views

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 ...
4
votes
0answers
23 views

Forward Autocorrect to a script [duplicate]

Possible Duplicate: How do I get bash completion for command aliases? I wrote a series of scripts to make package management a little more intuitive for me. However, I can no longer tab ...
5
votes
2answers
455 views

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 ...
7
votes
2answers
1k views

Create bash completion script to autocomplete paths after is-equal sign?

I want to create a bash completion script which recognises arguments of the form --arg and --some-arg=file. After reading this tutorial and some examples in /usr/share/bash_completion/completions/, ...
5
votes
1answer
215 views

Custom bash autocomplete for git breaks other git autocomplete features

I am trying to add autocompletion to git commit upon hitting TabTab. The autocomplete feature I am working on is based on a branch-naming convention. The convention is to append the PivotalTracker ...
1
vote
1answer
344 views

refresh bash tab completion

I have a script for auto-completing my ssh-hosts. If I change my ~/.ssh/config the auto-completion is not updated automatically, though. This does not surprise me. In a new shell, the new entry is ...
2
votes
2answers
1k views

How to fix Linux filename tab autocomplete that is appending a space instead of trailing slash on directories?

For some strange reason my filename autocomplete is behaving differently than normal. Given the following file structure ./foobar/file.txt, if I want to delete file.txt, I type rm ...
1
vote
2answers
96 views

bash autocompletion resets on every window

My terminal autocompletion does not work properly when I use root. source /etc/bash_completion works if I invoke that manually. I need to write above code in every new root terminal to be able to ...
4
votes
2answers
352 views

How to specify timeout for tab completion in zsh?

Zsh's completion feature is great except for this one. When I try to complete in a folder with lots of files/network folder, it takes a couple of minutes and prints this error. example.com:~$ ls ...
4
votes
2answers
303 views

Inhibit Variable Expansion in Paths

How do I prevent Zshell (and Bash I assume) from expanding environment variables in paths be completed as shown in the following example: $PREFIX/alt/li should expand to $PREFIX/alt/lib and not ...
2
votes
1answer
154 views

Change completion behaviour with brace expansion in zsh

I have got used to using tab-autocompleting inside braces without expanding in zsh. This was possible, while I used zsh with a basic grml-config. Since I migrated to oh-my-zsh, I can't reproduce this ...
1
vote
1answer
76 views

Tab completion when `patch` asks for filename

When the patch command doesn't find the file to patch, it asks for a filename. Is there any way to get this to use tab complete?
4
votes
1answer
53 views

List the bash completion that's current active on a program?

Is there anyway to list the bash completion function in use for current command ? e.g for ls