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)

4
votes
1answer
162 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 ...
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 ...
10
votes
1answer
356 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
2answers
230 views

Trouble w/ bash programmable completion of filenames matching patterns

I've got a simple command named th. I've got a bash-completion file for it that goes as follows: _th() { COMPREPLY=() local curr=${COMP_WORDS[COMP_CWORD]} COMPREPLY=( $(compgen -f -X ...
0
votes
2answers
304 views

bash autocompletion not working for filenames (Debian wheezy 64bit)

Bash auto completion seems to work normally except on files. ie, if I am in / and there is some directory structure / folder1/ folder2/ fileName nameOfFile other2/ otherfolder/ I can ...
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: ...
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 ...
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 ...
4
votes
1answer
1k views

Why is zsh (oh-my-zsh) completing directories that don't exist?

UPDATE 3 I've worked out that these annoying autocomplete options are actually usernames. I.e. they exist in /etc/passwd I have users such as _kadmin_admin and _kadmin_changepw and many others ...
1
vote
3answers
293 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 ...
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 ...
9
votes
2answers
801 views

Command line prediction

I've found an interesting paper: Predicting UNIX Command Lines about command-line prediction (based on user past activity), and I wonder if any actual implementation of such thing exists?
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
2answers
443 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 ...
1
vote
3answers
601 views

vi <TAB> completes only directories in bash

In a directory I type vi and then tab (twice), this gives me user$ vi CMakeFiles/ global/ libs/ whereas ls followed by 2 tabs gives me user$ ls ! core.log CMakeFiles/ global/ libs/ ...
1
vote
1answer
335 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 ...
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 ...
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 ...
2
votes
3answers
488 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: ...
7
votes
1answer
298 views

Need help on this bash auto completion script

I'm trying to setup autocompletion for a command, which takes only one parameter, a folder name, In /secure/kernel_builds/, I have the three following subfolder: 3.5.6/ 3.6.2/ source/ Now I want ...
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 ...
2
votes
1answer
166 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 ...
1
vote
2answers
95 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
302 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
3
votes
2answers
413 views

How to enable local ~ autocompletion for scp?

Too late: The machine, OS and configuration in question is no longer in use, so I can't verify any more suggestions. I have not encountered this problem in Fedora or Arch Linux. If you are having this ...
2
votes
2answers
348 views

Executing zsh rehash after build

I have a build script that can change what binaries are in my $PATH (it doesn't edit $PATH itself, but it adds/deletes files to folders that are already in $PATH). zsh's autocompletion doesn't update ...
3
votes
1answer
654 views

oh-my-zsh completion on home directory names

I recently switched to zsh from bash, and I'm using oh-my-zsh. There's a completion behaviour I don't want: in any directory, the list of autocompletion candidates seems to include the names of all ...
5
votes
1answer
734 views

Git auto-complete

I am using Git as many of you do. Also, I don't use any GUI for that — just CLI. So I was wondering: are there any way to make Git commands (git status, git checkout etc.) complete themselves when ...
19
votes
0answers
401 views

Completing avfs fake directories in zsh

How can I tweak zsh's completion system to complete “fake” files in some circumstances? More precisely, the AVFS filesystem exposes archives as directories by creating a “fake directory” next to ...
6
votes
3answers
446 views

Bash autocomplete gives different file name than ls

An incredibly strange thing just happened. Through a serious typo, I entered cp filename.xsl .^?~ Yeah, that's right, dot-caret-questionmark-tilde! Truth is stranger than fiction. It gets weirder. ...
5
votes
3answers
922 views

Auto-completion of words from the terminal buffer

In editors like vim and emacs, one can use hotkeys like C-p (vim) or M-/ (emacs) to perform auto-completion on the current word using other words in the same buffer. Is it possible to achieve the ...
3
votes
1answer
374 views

Vim insert mode completion for sentences

I would like to have insert mode completion for sentences rather than lines in vim. C-x C-l completes lines, but cannot complete sentences that do not start with a new line. For example: I have a ...
5
votes
1answer
474 views

Cancel zsh tab completion

Is there a way to cancel a completion once it has been started? I sometimes foolishly press tab to autocomplete make targets (only from sheer indolence) and then end up having to wait for a longer ...
5
votes
2answers
906 views

vim custom pop up menu

How do I create a custom completion pop up menu. I would like to be able to begin typing a part of a string then press a custom key combination to bring up a pop up completion of just a certain group ...
0
votes
2answers
660 views

Phrase Express Equivalent for Linux?

Is there some sort of auto text-insertion program with macros, similar to PhraseExpress for Windows in Linux? In case you've never seen this application it offers the following features: Organize ...
4
votes
2answers
2k views

What causes ln: //: Is a directory?

When linking a directory to root, I get this error: $ ln -s ~/inbox/ / $ ln: //: Is a directory Bash autocompletes the directory path by adding a /. I've tried escaping without success. $ ln -s ...
0
votes
1answer
474 views

How to disable autocompletion for sudo …?

I am new to zsh and I like it a lot, especially with oh-my-zsh plugin. I installed oh-my-zsh with its default values and can't figure out how to turn off autocompletion for specific commands, that I ...
3
votes
2answers
675 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 ...
2
votes
1answer
228 views

How ignore PATH with `source` completion

I can't find any 'detailed enough' documentation about zstyle, and I'm surprised that no one faced this problem before: here is what I get with tab completion: source l<TAB> l2ping* ...
2
votes
1answer
107 views

Complete only at the beginning of the word

I've got an issue with ZSH autocompletion, and I can't find the right keyworks to get rid of it. For instance, with files like $ ls Accelion, titi toto tata I would like to write: $ ls ...
4
votes
3answers
2k views

How can I expand a relative path at the command line, with tab completion?

In bash is there any way to expand a relative path into an absolute path, perhaps with tab completion? I ask because sometimes I will search for a file, find it, then vim it: cd /etc cd apache2 cd ...
3
votes
1answer
455 views

Complete files from a different directory in bash [duplicate]

I wrote two functions push and pull to copy files to and from a directory ($FILE_EXCHANGE_DIR). I want bash to autocomplete names from that directory when I use the pull function. I want the ...
12
votes
1answer
521 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 ...
18
votes
3answers
5k views

How to enable autocompletion for remote paths when using scp?

I remote copied a file to my laptop using: scp someFile USER@192.168.178.32:/home/USER/put/it/some/where/oh/damn/you/here I want to be able to autocomplete the remote path by hitting tab.
2
votes
1answer
361 views

Configure autocomplete for the first argument, leave the others alone

I have a utility that takes a load of different arguments. For now, I want to autocomplete the first argument, but leave all the others to fall through to normal autocompletion. How do I do that? ...