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)

2
votes
1answer
18 views

zsh auto completion certain parts of directory

I currently have zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' which will ignore the case when auto completing directories. However is it possible to type a certain part of the directory and ...
1
vote
0answers
27 views

How can I programmatically access zsh completion?

zsh has a completion system, activated by pressing tab: llama@llama:~$ git st<Tab> Completing main porcelain command stash -- stash away changes to dirty working directory status -- ...
12
votes
2answers
6k views

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 ...
1
vote
0answers
9 views

How did I get the git commits to show up in autocomplete?

Git tab completion on my mac: Git tab completion on my Ubuntu server: On my mac and my Ubuntu server I get very different output from tab completion despite having the same version of zsh, same ...
2
votes
1answer
22 views

How to properly use “complete -G”? [duplicate]

I've generated the simplest code I could think of to illustrate my problem. Suppose I want the "foo" command to work with files that end with ".cc". complete -G '*.cc' foo Now let's suppose my ...
2
votes
2answers
77 views

Add trailing slash in bash completion of directory symbolic links

I have a symbolic link for a directory, e.g ln -s /tmp /xxx Now when I type /xx and press tab key, bash would complete the line to /xxx If I press it again it become /xxx/ Now, how can I ask bash ...
1
vote
2answers
32 views

Autocomplete hostnames when using SSH within history file

I'm looking for a feature that help me to autocomplete the servers I "sshed" in sometime and are in my .bash_history file without messing with known_hosts file or /etc/bash_completition, just grab ...
1
vote
0answers
40 views

Smart case completion in Bash?

In Vim, one can combine the following commands, :set smartcase + :set ignorecase, to make searching case-insensitive unless there is a capitalized letter in the search query, in which case it is case-...
4
votes
2answers
71 views

Why does path-completion in bash not always work?

With different bash-environments (different installations) I have different behaviors in terms of path-completion when hitting TAB on the command line after . Where is this handled? One specific ...
1
vote
0answers
37 views

Can I change how zsh autocomplete works?

I love the zsh autocompletion for navigating in files with commands like cd, but some commands have weird autocompletion, for example: when i type snap ins, bash autocompletes that to snap install, ...
1
vote
1answer
23 views

How to change the key for autocompletion in ZSH?

I'm on Ubuntu Mate 16.04 using terminator as my terminal. And using ZSH version 5.1.1. I'd rather change the keybinding to the left arrow key to emulate fish in a way. Anyone know how?
2
votes
0answers
25 views

custom zsh autocomplete

I'd like to write a zsh completion for pytest. Where do I Start? I'm using oh-my-zsh. in .zshrc: fpath=($HOME/.mycompletions $fpath) autoload -U compinit && compinit -u in $HOME/....
1
vote
1answer
30 views

How to stop bash being too smart restricting completion options?

I often come across bash getting in my way when I'm doing something like this: cmake -DCMAKE_INSTALL_PREFIX=/usr/<TAB><TAB> Apparently, bash doesn't see that cmake can accept paths and ...
4
votes
5answers
440 views

Why can't I use tab expansion/auto-complete of shell variables with cd?

I have setup a variable in .bashrc: export SOME_DIR=/path/to/some/dir Now, with ls I can type ls $SOME_DIR[tab] and the variable will be expanded, and I can then use tab for auto-completion when ...
3
votes
0answers
52 views

Can bash to syntax highlighting, git info prompt and autocomplete based on the middle of a word?

I'm using prezto framework for zsh and started wondering if I really need zsh. Main features I really dig are syntax highlighting for commands, fancy prompt when in a git repository and the ...
2
votes
1answer
76 views

Bash completion extra words Fedora 23

I am new to using Linux. :) Today I noticed some extra words when TAB completing dnf search. I am not sure how to google this (I tried, but with no success), so please help. :D Anyone has any idea ...
0
votes
0answers
12 views

Any good way to momentarily block submitting a command if a tab-completion is ambiguous?

Occasionally I go to type a command, think I've gotten enough of the filename that Bash can complete it, hit Tab, and then hit Enter before I notice that the filename didn't complete. Most of the time ...
3
votes
2answers
62 views

rlwrap: tclsh multi-word autocompletion

How do I get multi-word autocompletion with rlwrap for tclsh? Example: I type file <space> then pressing <tab> <tab> I only want to see the sub-commands to file, such as exists ...
5
votes
0answers
43 views

Bash completions -C vs -F

In the bash completion setup (https://github.com/scop/bash-completion) supplied by my system there seems to be an unequivocal preferences towards completing with complete -F as opposed to complete -C. ...
9
votes
0answers
64 views

Completion for the first argument of cd OLD NEW

In zsh, the cd command has a two-argument form: cd OLD NEW changes to ${PWD/OLD/NEW}. With the new-style completion system, zsh is capable of completing NEW: the second argument is completed based on ...
0
votes
1answer
31 views

How to enable bash completion in vi mode on Synology DSM6

When I turned on vi mode in bash by setting set -o vi suddenly the tab completion was broken, and a literal tab was inserted. How can this be fixed?
1
vote
1answer
14 views

How to include all PIDs in tab completion?

When I enter a command that takes a process ID (such as kill and strace -p), ZSH's tab completion offers what looks like the PIDs of the processes running in my current shell session. How can I make ...
2
votes
1answer
54 views

Tab to show directory contents

I use the terminal app on OSX. Whenever I cd into a deep directory I find it useful to display the successive directory contents as I go. By tapping tab when typing the filepath, it lets me see the ...
1
vote
1answer
64 views

zsh fails at path completition when command is vim

When I try to autocomplete files (with vim as argument 0): vim ~/.conf <TAB> It shows: _arguments:450: _vim_files: function definition file not found _arguments:450: _vim_files: function ...
2
votes
2answers
71 views

Relationship between zsh custom completion script and compsys/zstyle configuration

I have written a simple completion script for a command cheat so that when using cheat at a prompt zsh will autocomplete arguments. (obviously) this needed to be setup in a compinit / compsys ...
3
votes
0answers
28 views

How can I use a key other than <ENTER> to exit zsh's completion menu/widget?

Like alot of zsh users I have completion configured so that when I am at a command prompt and I invoke completion a menu appears that can be navigated with the directional arrow keys. i.e. in my ~/....
12
votes
2answers
3k 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 ...
1
vote
0answers
18 views

Can I get zsh to include the directory stack in tab completion for tilde (~)?

I have autocd, autopushd and pushdminus enabled. When I try tab completion with ~: $ ~<Tab> avahi ftp mail redsocks systemd-coredump systemd-timesync bin gdm nm-openvpn ...
3
votes
1answer
92 views

Bash script - auto complete for user input based on array data

In a bash script I'm reading some user input with read. Now I want to provide the possibility to auto-complete the input by hitting the Tab key. Easy example: Let's say, the user shall type in a name ...
4
votes
3answers
1k 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 *...
1
vote
1answer
24 views

Can I selectively disable zsh completions?

I'm using prezto with zsh, and find it a little slow to launch a new shell. (N.B. I'm attempting to optimise on a fast-ish system, before moving my configuration to other, slower systems.) ...
3
votes
1answer
32 views

zsh: menu completion for glob

In zsh, if I type vim *.txt then Tab, it expands to vim f1.txt f2.txt f3.txt. How can I make it show a completion menu listing files matching the pattern, so I can select a single file?
11
votes
2answers
3k views

Zsh completion of brew formulas

In OS X, is there any way to have Zsh (I'm using Oh-my-zsh) tab-complete formulas? E.g. $ brew install em<TAB> could expand to: $ brew install emacs
3
votes
1answer
54 views

Why does nullglob affect tab completion?

After shopt -s nullglob, I noticed that tab completion completely stopped working. Why would that be? extglob is apparently benign, what else could nullglob affect? Observed on: Ubuntu 14.04 (bash ...
1
vote
0answers
35 views

Disable Oh-My-ZSH Completion of Beginning of Filename

I'm starting to use the directory stack in ZSH, but I've run into a problem. In an ideal directory, typing cd -<TAB> gives me the output of dirs -v. However, in some others (i.e. my Downloads ...
2
votes
1answer
96 views

Directory stack order discrepancy 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, ...
3
votes
1answer
77 views

Is there a way to use regex expressions to auto-fill filenames in bash?

Assuming I have a directory with files as shown: $ ls file0001.txt file0002.txt file0003.txt file0004.txt file0005.txt someotherfile.txt Lets say I want to run the following command: $ cat ...
55
votes
2answers
35k 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?
2
votes
2answers
93 views

How can I remove a command from bash completion?

For bash completion, I would like to replace youtube-dl with youtubedl. I can make an alias for youtubedl, however, both youtube-dl with youtubedl will exist. Primarily, I just want to remove ...
1
vote
0answers
25 views

How to have full completion in a run application dialog?

I've configured XFCE to execute gmrun as run dialog (Alt-F2). It works great with completion on commands but does not propose completion on arguments. How to set up a run dialog with full bash/zsh ...
3
votes
2answers
53 views

Bash completion for user without access to /etc

I'm using a Chromebook (with a developer mode enabled), and as someone of you may know, there is no write access to the system directories (including /etc/). I'd like to enable the bash-completion ...
5
votes
1answer
64 views

What's the relevance of these bash completion suggestions?

~ is $HOME. For me, cd ~ is /home/cat. Simple so far, yes? In Bash, the following happens: cat @ mint-kitty : ~/Downloads $ cd ~ # from /home/cat/Downloads to /home/cat/, as an example, but ...
0
votes
0answers
19 views

autocomplete in noexec mounted drive

I noticed that bash won't let me tab-complete executable files in a noexec file system. I'm assuming that in order for it to actually auto-complete, the file has to be within the PATH and at least ...
4
votes
1answer
48 views

Use same colors in bash tab complete and ls [duplicate]

Bash is using a different color for tab completion than ls. For example, my ls command uses a red color for a broken symlinks (I'm using dircolors to configure it), but if I use ls Tab, the color is ...
0
votes
2answers
31 views

Why isn't the tab-key autocompleting under Xfce4?

I have a big problem under Xfce4, namely when I try to start a program using alt+F2, I'll start typing xfce4-terminal and before I finish it, it suggests the end of the sentence--but usually you ...
1
vote
1answer
54 views

Bash Autocompletion - Insert words in commands

I know that linux bash has autocompletion feature when TAB is pressed and it will show possible completions just below the command. My question is how can you update autocomplete feature so that in ...
5
votes
1answer
825 views

Can the command completion for `cd` be modified to only show directories and ignore files?

When I am in a directory in bash, and I press cd Space Tab, it shows everything in the directory as a possibility. (Show all 1000 possibilities?) This is really cumbersome when I am in a directory ...
1
vote
1answer
42 views

Clever complete of .c and .o

I would like that bash completes my command vim myPrTab to vim myProgramName.c even if the current folder also contains a file called myProgramName.o, since 99.9% of the time I want to open the source ...
1
vote
2answers
169 views

Add arguments when completing a command name

I am looking for a way to expand some predefined strings in the terminal when tab (or another key combination) is pressed. This is different from tab completion. My terminal already expands ~ to my ...