Questions tagged [tab-completion]

Tab completion is a user interface enhancement for shells and other command line programs. Typing the first few characters of a command (or argument) and pressing the Tab key results in the rest of the word being automatically completed by the program.

Filter by
Sorted by
Tagged with
0 votes
0 answers
28 views

How can I complete individual command line phrases / do partial completion with fzf?

With fzf I can press CTRL-R to search my command history but it completes the whole command. What I'd like is to just complete the current argument, the next phrase before the next space. Can this be ...
3 votes
2 answers
691 views

How can I turn off completion cycling in zsh?

How do I prevent ZSH cycling through matching completions but instead just presenting a list of remaining possibilities in a list? On my more recent OS installations I've started getting ZSH cycling ...
7 votes
2 answers
2k views

Bash: always display file possibilities on tab-complete

When I use tab for filename completion and there are more than ~100 matches, it displays something like "Display all 403 possibilities? (y or n)". This gets annoying when I do it many times a day. Is ...
2 votes
2 answers
1k views

urxvt - tab expand environment variables

I am new to urxvt (moved from gnome-terminal -> Ubuntu 12.04 refugee). I am used to having environment variables expand in gnome-terminal by default Suppose that I have an environment variable "...
1 vote
1 answer
66 views

zsh completion ( compctl ) does not trig for command names containing dashes

I've used zsh compctl since forever (late 90s or early 00s) but strangly never run into this before. I realized today when I intended to make some compctl config for update-alternatives that my ...
3 votes
1 answer
1k views

Add strings to zsh tab completion for all commands and arguments

I want to add the keywords foo and bar to be added to the auto completion results for any command or argument. eg: cd <TAB> should give foo and bar in the suggestions in addition to the ...
5 votes
1 answer
1k views

Completion stops working in /root directory

If I am in a root terminal su, then everything is fine: completion is OK everywhere. The problem arises if, as a normal user, I try to use sudo to reach the /root/ directory , for instance, if I want ...
5 votes
2 answers
1k views

Access Finder's "Open With" menu from the commandline (for tab completion)

On Mac OS X, I know one can open a file from the commandline with its default application with open, and with other applications with open -a <application name>. Thus, open movie.avi open -a ...
0 votes
0 answers
52 views

PhpStorm function name suggestion with variables

How to make PHPStorm code completion to suggest function name with variables, not only it's name? For example, I have next function: function sample1($understandable_variable_name1, &$...
0 votes
0 answers
332 views

Tab-completion when running a python3 script

In Ubuntu, I'd like to be able to use tab-completion when running python. For example, if I wanted to use vim to edit a file 'myscript.py3', I'd write 'vim my' and pressing tab would complete the ...
0 votes
1 answer
136 views

Better Tab-Tab experience for file-completion if directory is big (Bash)

In ~/tmp/ I store some files while working on the command line. ❯ ls ~/tmp/ [TAB-TAB] Display all 119 possibilities? (y or n) Usualy I want to work on a file which has recent ctime. Is there a way ...
4 votes
1 answer
522 views

How do I get zsh tab completion to "vi **/foo<TAB>" to match and complete the first file matching "foo*" anywhere under the current directory?

How do I get zsh tab completion to cat **/foo<TAB> to match and complete the first file matching foo* in any subdirectory under the current directory? For example, do this while inside a fresh ...
0 votes
2 answers
1k views

Is it possible in bash to complete the middle of a word?

I have a simple bash completion script for my custom git branch searcher. #/usr/bin/env bash _branch_completions() { local word="${COMP_WORDS[COMP_CWORD]}"; if [ ! -z "$word" ] then ...
1 vote
1 answer
745 views

Why would bash refuse to be case-insensitive?

I am working on a server where I seem to be unable to set bash to be case insensitive. I have the shell set to, set completion-ignore-case on But this does not seem to be working. I am working over ...
48 votes
1 answer
28k views

How can I make zsh tab completion fix capitalization errors for directories and files?

I switched to zsh completely on a previous arch install and I LOVED it mainly because arch is one of the distros that capitalizes your Documents, Downloads, Music and such directories in your ~ ...
1 vote
2 answers
2k views

How do I resolve a keybinding conflict with coc for vim?

Just as a preface, I'm not a programmer, but I've written a bit of shell to automate things. This is on MacOS Mojave, but it shouldn't make too big of a difference since neovim's configs should carry ...
5 votes
4 answers
5k views

zsh completion will not work in emacs shell

I'm learning about the more powerful tab-completion and expansion capabilities of zsh, and they don't seem to work when I run zsh under emacs with M-x shell: cat $PATH<TAB> expands the tab ...
1 vote
1 answer
927 views

Git not autocompleting with the switch command

I'm trying to switch my behaivour to use switch and restore instead of checkout, but I'm running into a huge problem when trying to use git switch to switch branches. My company has a naming ...
58 votes
5 answers
19k views

How can I get bash to perform tab-completion for my aliases?

I have a bunch of bash completion scripts set up (mostly using bash-it and some manually setup). I also have a bunch of aliases setup for common tasks like gco for git checkout. Right now I can ...
5 votes
11 answers
2k views

How to minimize typing when frequently changing directories?

What are some good Linux commands to make switching between different directories on the command line easier? I often have to switch between different directories with long names, e.g. cd foo/20100801-...
1 vote
1 answer
746 views

Understanding zsh blobing, alias, and tab completion

I am new to zsh and recently moved on from csh, due to obvious reasons. Oddly enough, its taking me slightly longer than I expected to port a lot of aliases which I use extensively. Here's one of ...
1 vote
1 answer
505 views

Setting Environment variable for bash/zsh completion

I am using gnu pass with bash/zsh completion. This means when I type pass a[TAB] the shell suggests which passwords I have available starting with a. I have two gnu-pass directories, when I want to ...
2 votes
1 answer
470 views

Add shell (bash/zsh) tab completion to custom command by running existing completion with arguments

In our code base we have a few convenience executables that are automatically loaded to the environment for anyone cloning the code (using direnv). This is a general question, but for the purpose of ...
2 votes
0 answers
71 views

How to use tab for text auto complete system wide?

Mac OS suggests completions of some text in some instances. A particular example would be when writing an email. The default way to choose the suggested text is to use the downward arrow to highlight ...
3 votes
1 answer
713 views

tmux completion (not shell completion)

Is there any way to do completion of arbitrary text from your tmux session (e.g. output from previous commands)? Something similar to hippie-expand in emacs or Any word completion in vim? Note that I'...
2 votes
1 answer
997 views

Run command on tab completion in zsh

I'm trying to set up a zsh function that will take me back to the top level git directory with an optional argument to move relative to that directory. I've currently got this which works: alias ...
0 votes
1 answer
150 views

Disable bash completion of asterisk when ambiguos

My bash is autocompleting filenames in an unexpected way. I have a directory with 2 files: $ ls ssh-8ZwoymYvfDSu ssh-ha7JCIFmjUKR When entering some prefix of the name and pressing <tab>, bash ...
0 votes
1 answer
181 views

Tab doesn't expand the path when using $_ to access the previously typed path

Consider the following scenario: I've used ls to list the contents of a directory, and I've used Tab to find the right directory, so I don't know the full path. And it's a potentially long path, so I ...
1 vote
1 answer
3k views

How do I make bash completion behave like this?

I’m not sure if what I’m asking is possible, but what I would like bash to do on tab presses is this: On the first tab press, expand a common prefix (skip/beep and do nothing, I don’t really mind, if ...
4 votes
1 answer
3k views

zsh: Select menu auto-completion with single Enter/Return press

Once finding the auto-completion I want to select from the completions menu, I currently need to hit <Enter> twice - once to add the selection to the terminal, and once to execute the command. ...
7 votes
2 answers
2k views

Tab completion for .bat files in Git-for-Windows Bash

Git for Windows installs "Git Bash," a bash shell that works in Windows, which is very nice. It's based on MinTTY, I believe. As well as bash shell scripts, it can also execute Windows batch (.bat) ...
3 votes
1 answer
1k views

Tab completion closes SSH connection

I am using SSH connection to log into my Raspberry Pi. I used tab completion over SSH before and that worked perfectly. But now I am getting the "connection closed" message whenever I try to use tab ...
2 votes
1 answer
2k views

Bash filename tab completion

I have noticed sometimes that tab completion is helpfully filtered in bash. I am a java programmer and often use the java and javac commands in the terminal for quick or remote tasks. Say I have the ...
0 votes
1 answer
285 views

Enable all defined bash completion after a custom command

I have a custom script called oEd which basically runs any bash command following it and opens the output in my favorite Editor. Is it possible to enable all defined bash completion (supported by my ...
6 votes
2 answers
2k views

Bash auto-completion of variables adds additional white space at the end

When I perform an auto-completion of a bash variable, an additional whitespace character is added at the end. So this: $FO[TAB] Becomes this: $FOO" " I added the quotes in order to denote the ...
2 votes
1 answer
962 views

How to Expand Abbreviations Inline in Fish Shell?

I'm trying to save some time in Fish Shell by setting an abbreviation (nu) to expand to the string: my-username@my-ip-address:/home/my-username What I'm hoping to achieve is to enter: scp some-file ...
4 votes
5 answers
1k views

Command-T for shell

I'm looking for a shell extension that allows me to do filename completion similarly to Command-T. Command-T a feature in TextMate and a plugin for Vim that allows you to select filenames by typing ...
4 votes
0 answers
677 views

How can I get bash to perform case insensitive tab-completion for my aliases and functions?

I have an alias like this: alias sshUntrusted='ssh -X -C -c blowfish-cbc,arcfour' But when I type $ sshun followed by Tab, Bash does not complete the alias. I have put set completion-ignore-case ...
4 votes
0 answers
153 views

TAB completion with .bash_history

I usually use PageUp/PageDown to search through .bash_history given a prefix. However, I regularly catch me pressing TAB multiple times before realizing that I need to use PageUp/PageDown in this ...
4 votes
1 answer
228 views

Why does a value '-' (hyphen) in "tag-order" style prevent matching of the "executables" tag even if that tag is explicitly specified?

With the code below, everything works as expected: When I write c and hit the TAB key, I get the appropriate completions in correct order. When I write ./ and hit the TAB key, I get the ...
1 vote
0 answers
240 views

How to customize the look of currently selected(highlighted) completion in zsh?

Main question I would like to add powerline characters at the start and at the end of the selected completion, like this: Started the completion menu by inserting a c and pressing the TAB key. ...
43 votes
1 answer
15k views

Make bash's tab-completion case-insensitive [duplicate]

Possible Duplicate: Case insensitive tab completion in Bash Is there any way to make the tab-completion in bash case-insensitive? For instance, if I have a file called Hello.txt and try to tab-...
0 votes
0 answers
45 views

PhpStorm 2017 autopopup completion not working outside <> symbols

If I type < symbol and then continue typing, autopopup completion works just as intended: But outside of <> tags(either html or php - <a></a> or <?php ?>, for example) ...
5 votes
2 answers
2k views

Bash Autocomplete Subdirectory for Custom Command

I have tried for hours to get this working and feel like I've not come anywhere close. I am trying to shorten our workflow by tab-completing directory names from the Mac OS X Terminal. We have an ...
5 votes
3 answers
380 views

How do I abort building the list for tab completion without losing the command?

some_very_long_command_line --arg1 --arg2=555 --arg4 ... ... ... && <now Tab pressed> (Now it works. I want to cancel before the following message) Display all 6936 possibilities? (y or ...
8 votes
1 answer
2k views

Bash partial glob expansion

I have a question similar to this one, but different: I want bash to use a glob expansion in auto-completion, if possible. For example, I would like $ ls *2.<TAB> To give me: $ ls mydoc2. ...
4 votes
1 answer
2k views

Tab completion for command arguments fail in Cygwin due to `.exe` extension

Is there a configuration option in Cygwin so that when Bash completes the name of the command, the filename’s .exe suffix is ignored (not included)? Explanation of the problem When using tab ...
2 votes
1 answer
1k views

zsh completion list-colors - partial colouring issue

Inspired by https://stackoverflow.com/questions/23152157/how-does-the-zsh-list-colors-syntax-work I wanted to have a different colour for the per-match descriptions in the menu list, but I can't get ...
0 votes
1 answer
212 views

Is it possible to have tab completion of drop-down lists in web pages in Firefox?

Does anyone know of a Firefox plugin that would enable tab-completion (or some other key sequence like Alt-L) of items in drop-down lists in web forms? e.g. ou<TAB>in<TAB>s<TAB> ...
2 votes
1 answer
267 views

Branch names not showing in Mercurial's tab completion

I have a development machine running mercurial 1.6.3. Tab completion in bash works great for completing commands, tags and branch names. I've set up a new machine with the same mercurial version (both ...