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)

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
54 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
2
votes
2answers
354 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
677 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
755 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 ...
5
votes
3answers
940 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 ...
6
votes
3answers
453 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. ...
3
votes
1answer
383 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
480 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
930 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 ...
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
476 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 ...
2
votes
1answer
229 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
487 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 ...
2
votes
1answer
369 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? ...
9
votes
5answers
2k views

Weird Stuff in Terminal When I Hit Tab

For some reason, today, everytime I hit tab in the terminal this shows up: cat bash: warning: setlocale: LC_CTYPE: cannot change locale (en_CA) Display all 150 possibilities? (y or n) This ...
1
vote
1answer
635 views

Autocompletion for Makefile rules in tcsh

I'm using tcsh in a SUSE 11 box and I realized that when typing makeTab it allows me to auto-complete the rules available within the Makefile, not the files that are inside the current directory. ...
3
votes
1answer
312 views

ZSH takes two tabs to complete filenames

I love Zsh's tab completions, but it's frustrating when there is only one possible option and I have to tab twice to tab complete the filename. For example, if this is a list of files in a directory: ...
2
votes
1answer
139 views

Files with no .sh extension not considered for autocompletion in zsh

I have noticed that unless I add an .sh extension to my shell scripts, Zsh does not suggest them for autocompletion for execution despite having them in my PATH. I have the same problem if I cd into ...
9
votes
3answers
641 views

How to pipe the list of commands displayed by of “tab complete”?

When using commands in bash I like the double tab option to display the available commands. Some commands have more possible matches than others: Is there a way I can pipe the output of the double ...
7
votes
1answer
355 views

How to output string completions to stdout?

Some of the git commands have many options, and it would often be useful to search through them for the one I need - I was just looking for the option which controls the TAB width in git-gui, but ...
6
votes
4answers
2k views

How does Bash path completion work with sudo?

Tab path completion does not work (at least on Ubuntu and AFAIK Arch) with sudo mount <whatever> The iso file I am trying to mount is not in /etc/fstab. If I just type mount <whatever> ...
2
votes
1answer
2k views

Terminal does not source .zshrc with custom colors for ls and cd command

I customized the directory and file colors for ls and cd + TAB. Here is my configuration. My configuration My system environment. Ubuntu 10.10 zsh 4.3.10 (x86_64-unknown-linux-gnu) oh-my-zsh // ...
5
votes
1answer
277 views

zsh - fully expand binary path on <tab>

In my current zsh behaviour, hitting tab after typing "sudo" just adds a space. $ sudo ... What I really want is for the tab to fully expand to the path of the binary it is about to execute when I ...
3
votes
1answer
237 views

Pipe zsh auto completion list to file or less

zsh: do you wish to see all 923 possibilities (462 lines)? Yes please, but in a file or less.
4
votes
2answers
307 views

zsh autocomplete directory

I'm new to zsh and one thing that I do quite often is execute shell scripts that are in a directory of mine called Scripts. I'm not always inside of the Scripts directory, however... I may be in ...
4
votes
1answer
358 views

Custom bash completion with directories and a fixed set

I'm trying to setup a bash completion, and have two problems For parameter one, I needed a completion for directories For parameter two, a fixed array for completion, I just don't know how to let ...
4
votes
1answer
827 views

Autocomplete of filename in directory

This question is quite similar to this one, but I can't understand the solution. I also know this tutorial, but still I am unable to understand what I am doing wrong. I am trying to autocomplete the ...
2
votes
2answers
131 views

Bash completion for `unset` command

How can I setup bash completion for the unset command, like when you use echo $XXX, you can get a completion for XXX?
3
votes
1answer
317 views

Zsh autocomplete ls command with directories only

Suppose I have following files and directories: % ls bui00293 buiawer builds/ buiowpe/ I want to list the content of ...
1
vote
1answer
724 views

autocomplete filenames using compgen

As part of a larger autocomplete function I'm writing, I want to use compgen to generate a list of files. I read the bash manual entries for compgen and complete, and from there I assumed that the ...
8
votes
1answer
2k views

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 ...
4
votes
2answers
350 views

Saving tab completion possibilities to a file

Instead of displaying all possibilities on terminal screen, as in: $ ls /etc/<TAB> Display all 230 possibilities? (y or n) I want to save all possibilities to a file. ls /etc/ > file.txt ...
7
votes
1answer
252 views

compgen : ignoring case

I'm trying to implement a custom bash completion as described here. However, it seems that compgen is case-sensitive. Is there a way to turn it case-insensitive in that context ?
9
votes
2answers
2k views

Make BASH's Tab Completion Fill In First Match?

Is there any way to make BASH fill in the first match when I press TAB, kind of like the Windows command prompt? (It should still display the list of matches, but it should cycle through them when I ...
6
votes
3answers
1k views

Tab-completion for Mercurial in Bash?

Using Subversion on the command-line, it intelligently tab-completes available subcommands, etc: $ svn c<tab> cat checkout cl co copy changelist ci ...
2
votes
2answers
791 views

ZSH tab completion: only complete files and not binaries

Is it possible to make a custom zsh completion file,so when hitting tab for filenames it avoids completing the binaries? For example,I have 2 files , myprogram.c and myprogram,the binary,is it ...
1
vote
1answer
168 views

_path_files and compadd ignore-files parameter

What is the format for the -F option of _path_files and compadd? I'm passing several directories to _path_files: _path_files -W "($base_directories)" -/ But some of those directory trees I don't ...
3
votes
1answer
949 views

ZSH: insert completion on first tab even if ambiguous?

Currently ZSH displays a menu when I first hit tab and the completion is ambiguous. So, if I have 'cd ' in the command prompt and I hit tab, it will show the different available completions. If I hit ...
3
votes
2answers
119 views

Hiding a zsh completion

I just switched to zsh (from tcsh) and have only run into one serious frustration: There are multiple completions for push — pushd and pushln. I’d really like to only have pushd available, since ...
1
vote
1answer
312 views

How to have autocomplete ignore a specific completion

I've got auto-completion working for bash. When I type part of a program name, and then TAB, I get the full command. Works like expected, no complaints. However on my setup I've got an alias defined ...
20
votes
3answers
2k views

How does TAB auto-complete find options to complete?

And how does it also autocomplete aliases?
3
votes
1answer
847 views

zsh equivalent of bash show-all-if-ambiguous?

In bash, if you hit tab when there are multiple possible completions you get a list of matches that keeps reprinting if you repeatedly press tab. In tcsh, setting autocomplete to enhanced also ...
3
votes
2answers
720 views

zsh alias expansion

Is it possible to configure zsh to expand global aliases during tab completion? For example, I have the common aliases: alias -g '...'='../..' alias -g '....'='../../..' but when I type for ...
20
votes
2answers
12k views

An easy bash completion tutorial? [closed]

I want to learn how to write bash completion scripts. Which tutorial would you recommend for a newbie?
4
votes
1answer
858 views

When auto-completing in tcsh, can I reference a previous argument?

I'm trying to get some efficient auto-completing going here, and have hit upon a bit of a snag. I've got a command for setting two things at once. The first is a relatively small list, but the ...
5
votes
1answer
897 views

How do I get my shell functions to make use of existing autocompletion in zsh?

I have a couple of shell functions defined in my .zshrc which save on typing and allow integration with screen. For example: function s() { screen -t "$1" ssh "$@" } However, when I use these ...
11
votes
1answer
2k views

Add arguments from previous command to zsh completion

In zsh (as well as bash) you can use some history word expansions to denote arguments from previous commands. This example shows getting the 2nd parameter from the previous command in history with ...