Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

1
vote
1answer
31 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 ...
0
votes
0answers
27 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 ...
0
votes
1answer
235 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
0answers
60 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 ...
3
votes
1answer
168 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 ...
2
votes
0answers
112 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. ...
0
votes
1answer
154 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 ...
0
votes
0answers
23 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) ...
2
votes
2answers
355 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 ...
1
vote
0answers
63 views

turn of cycle completion?

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 ...
1
vote
1answer
354 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 ...
1
vote
1answer
317 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 ...
1
vote
0answers
49 views

Tab-Complete (alphabetically) last match

We have a setup where jobs are dispatched and their results stored in directories with the same name but different trailing time stamp; eg.: result_20170111T090200 result_20170111T130500 ...
1
vote
0answers
284 views

ZSH auto-completion help not triggering for custom command options beginning with “--”

I often use the gencomp command with RobSis's zsh-completion-generator to generate ZSH completion definitions, and it works great for the most part! There is, however, one small caveat that I have ...
4
votes
1answer
2k views

how can i make zsh tab completion fix capitalization errors? for directorys 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
1answer
392 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 ...
3
votes
1answer
338 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 ...
4
votes
1answer
1k 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 ...
4
votes
1answer
224 views

zsh autocomplete results from function

I've been searching and searching and unable to find a clear way to do this: Slightly contrived example to hide details: Say I want to autocomplete tmux session names with a command that will open ...
1
vote
1answer
460 views

How to bash complete an alias as the command [duplicate]

I have an alias alias gi=git Unlike git, gi cannot complete on subcommands, paths, branches. How can I tell bash to "complete X as if it were Y"?
0
votes
1answer
269 views

Trouble creating Custom Completions for Sublime Text 3

UPDATED I'm working on Salesforce development using the MavensMate plugin for Sublime Text 3. I'm wanting to create a custom completions file that will contain some common HTML tag class names that I ...
1
vote
1answer
128 views

bash/readline doesn't autocomplete directory name

I have an executable in a subdirectory of the current directory: ~ $ ls -l src/users -rwxr-xr-x 1 me users 1001K Nov 17 18:52 src/users* I try to execute it by typing sr and then clicking tab. There ...
1
vote
1answer
390 views

How can I regenerate the “bash_completions” file from “bash-completion/completions” directory?

Somehow my /usr/share/bash-completion/bash_completion file (which is sourced by /etc/bash_completion) has been deleted. However, the rest of the bash-completion directory appears intact: there is ...
2
votes
1answer
742 views

How do I view the tab completion function for a command in bash?

I ultimately want to alias screen -r. I mostly want to do this because that command has an awesome tab completion feature that shows me the current GNU screen sessions. I want that power with the ...
1
vote
1answer
191 views

history-search-backward ignores search text after first space character?

I use a lot of git commands and since they are mostly 2-word command names, matching doesn't find the closest match. For example: # type in some commands git checkout - git status mvn test # try to ...
3
votes
2answers
318 views

Completion when pasting Bash command beginning with tabs

I'm writing a Dockerfile which I'm formatting using tabs (which I usually use everywhere). But I've copied a multi-line command where the second line begins with two tab characters, i.e.: apt-get -y ...
1
vote
1answer
832 views

SublimeText XML completions file

I apparently can't get autocompletion to work in my XML files. Here is my xml.sublime-completions file, which I added to the User folder: { "scope": "text.xml", "completions": [ { "...
0
votes
1answer
42 views

tsch: tab-complete filename after --flag=

One the small annoyances I have in my daily use of tcsh is when I start writing a command like this: # do_stuff --input=/path/to/some I wish to use tab-completion to finish writing /path/to/some/...
0
votes
1answer
2k views

zsh completion for all executables in path

I have written a script which itself takes as an argument any arbitrary executable in my $PATH. Is there a way to create a zsh (or bash) completion function such that I would be able to type myFunc ...
3
votes
2answers
861 views

bash complete: list directory names from a defined directory?

I need the directory names in /mailman/lists to tab-complete as an argument (without any slashes) to the 'list_members' command regardless of where I am in the filesystem. In tcsh (on our old server),...
3
votes
1answer
457 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. ...
0
votes
1answer
33 views

Bash expansion to list from a directory

I tend to work on multiple projects, all stored inside my home (~) directory inside a directory called web. At one point all my projects were inside a single directory inside this; so to move from ...
3
votes
0answers
520 views

Can't tab complete in psql

For some reason, tab-completion isn't working in psql on my Mac. I can tab complete table and field names just fine in Ubuntu, but pressing TAB fails to work in Mac OS X. I can successfully use my Up/...
0
votes
1answer
206 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> ...
5
votes
3answers
794 views

Do not expand wildcard on tab completion

I'm wondering how I can configure zsh to not expand the wildcard in a filename. For example I have a directory of a couple hundred files named as following: a.foo-bar a.foo b.foo-bar b.foo c.foo-bar ...
1
vote
0answers
42 views

Reusing _kill completion in .bashrc fails

I'm trying to extend bash completion alias perf-connect-process="perf record -p"; alias pperf=perf-connect-process; complete -F _kill perf-connect-process; complete -F _kill pperf; by reusing the ...
2
votes
1answer
289 views

How to hide a program from Linux's tab-completion

I have an account on a shared machine, and cannot access /usr/bin, where there are many programs which I never use. I'd like tabbing to ignore many of these programs. For example, I'd like on<TAB&...
4
votes
0answers
374 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 ...
2
votes
1answer
174 views

zsh tab completion to run scripts in current folder (.<TAB>scr<TAB>)->./script.sh

I have an issue with zsh (or oh-my-zsh): When I want to run a script in current directory, I do ./script.sh. In bash I could do .<TAB> and it would give me ./ where I could continue typing the ...
1
vote
0answers
132 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'...
0
votes
2answers
255 views

A tab in Tmux results in an indent and tabcompletion

I ruined my tabcompletion in Tmux. When I use tabcompletion and I've multiple options which fit the prefix Tmux is acting weird. Assume I've a folder with subfolders downloads and documents. When I ...
1
vote
0answers
99 views

Tab completion that honors $CDPATH

I've installed bash_completion and set my $CDPATH. I can successfully cd to subdirectories of those in my $CDPATH. What I'd like to do from here is for tab completion to bring up files in those ...
1
vote
1answer
163 views

How does tab-completion “know” what files there are in sub/super folder?

I wonder how tab-completion knows that certain file exists in a directory above the current directory or in the working directory? If I have a file named foobar in a subdirectory and I type in foo ...
1
vote
0answers
89 views

How to make tab completion work within parentheses

On my Ubuntu machine, I can do this emacs $(which first-part-of-executable<tab> and bash will tab-complete the full executable name. I enabled this myself by adding complete -c which to my ...
0
votes
2answers
2k views

bash tab completion doesn't work on shell scripts

On my Fedora 19 system tab completion doesn't work for bash scripts when I have a sh at the beginning of the command line unless the script filename ends with a .sh. That is, if I type: $ sh file&...
3
votes
2answers
2k views

How can I prevent Supertab to try completion even if I just want to enter a tab?

Even when I have an empty buffer in vim, supertab tries to do a completion at the begining. How can I configure supertab to only try tab-completion if there's a character?
0
votes
0answers
236 views

Use zsh completion in vim instead of vim one

I like zsh completion where for example I can write f/o/fTab and get folder/other_folder/file.txt (I'm not sure, it's possible feature of oh-my-zsh, not zsh, but it seems that it doesn't matter) Also ...
0
votes
1answer
381 views

How to adjust tab completion in Sublime Text 2

Is there a way to "complete completion within completion"? Example: Completions: 'fra' => '\frac{$1}{$0}' 'bf' => '\mathbf{$0}' I do fra<tab>bf<tab> and want to have \frac{\mathbf{...
2
votes
1answer
404 views

bash tab-completion list below prompt

Whenever I use tab-completion, the list of possibilities is displayed and the prompt is duplicated below (| indicates the final cursor position): $ vim ~/.<TAB> ./ ../ .bashrc .vimrc $ ...
0
votes
0answers
59 views

Use two different completions in tcsh

I want to make a tcsh completion that completes with both a relative directory (ie p/*/d/), or the output of a command (ie p/*/'completionterms'/). Is this possible? Looking at the tcsh man page it's ...