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)

12
votes
1answer
529 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 ...
19
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
371 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? ...
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 ...
3
votes
1answer
313 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: ...
1
vote
1answer
637 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. ...
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 ...
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 // ...
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> ...
5
votes
1answer
278 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
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
308 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 ...
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 ...
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
832 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 ...
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.
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 ...
7
votes
1answer
357 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 ...
2
votes
1answer
672 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 ...
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 ...
9
votes
3answers
644 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 ...
11
votes
0answers
359 views

How to fix tab completion so it doesn't hide entries?

I'm using oh-my-zsh on Mac OS X with homebrew'ed zsh 4.3.12. I stumbled recently on a weird problem. In scripts/not-used I have several .R files: breakdowns.R eventloop.R ...
4
votes
2answers
351 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 ...
8
votes
6answers
409 views

How to disable emacs here document completion

When editing a bash script file with emacs, and trying to enter <<<, at the second < emacs insert a template for a here document, like in the following example: <<EOF EOF This is ...
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, ...
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 ...
5
votes
2answers
784 views

is there a way to set coloring for cd tab complete?

I use ubuntu 11.04. Is there a way to set coloring for output after tab completion listing of a cd, ls, or etc. ? i.e. myshell@root$ cd ~/user/files/ I hit tab... myfile myfoo mybar <-- this ...
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 ...
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 ...
3
votes
2answers
935 views

Bash and Tab Auto-complete

I recently put Fedora Core 15 on my system, and I've had a behaviour change that I can't figure out. Using Tab-Complete in the BASH shell works fine except when I use the $HOME variable. If I type cd ...
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 ...
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 ...
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 ...
20
votes
3answers
2k views

How does TAB auto-complete find options to complete?

And how does it also autocomplete aliases?
3
votes
2answers
729 views

How to change the target directory for tab completion?

I found a short script to enable note-taking on onethingwell, which includes this: function n { nano ~/n/$1.txt } I'd like to extend it to do tab completion, so that if I want to edit the ...
3
votes
1answer
951 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 ...
12
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 ...
3
votes
1answer
848 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
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 ...
5
votes
1answer
901 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 ...
3
votes
2answers
721 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 ...
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 ...
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 ...
5
votes
1answer
2k views

TAB autocomplete in Bourne Shell

I don't know how to get the TAB key to autocomplete filenames, commands, or anything at all. I'm on a Unix-like system (OS/390) and depend on several scripts that work in sh (Bourne shell, not ...
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 ...
18
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 ...