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
0answers
61 views

Custom expansions with tab

It is very comfortable to use the tab for completing commands and arguments in bash (and probably other shells too) I would like the option to have a way of specifying some predefined expansions that ...
1
vote
1answer
192 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 ...
1
vote
1answer
104 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 ...
1
vote
0answers
13 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 ...
0
votes
1answer
41 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 ...
2
votes
1answer
162 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 ...
0
votes
1answer
29 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 ...
2
votes
1answer
394 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. ...
3
votes
1answer
160 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 ...
1
vote
1answer
39 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 ...
0
votes
1answer
82 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 ...
2
votes
1answer
415 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
1answer
433 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 ...
2
votes
2answers
936 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) ...
4
votes
0answers
88 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
1answer
210 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
0answers
189 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
535 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
30 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
2answers
1k 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 ...
2
votes
1answer
145 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
625 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 ...
2
votes
1answer
583 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
51 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
481 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 ...
24
votes
1answer
11k 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 ~ ...
2
votes
1answer
671 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
872 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
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 ...
4
votes
1answer
271 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
715 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
361 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
146 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
849 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
1k 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
298 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
472 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
945 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
67 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 ...
5
votes
2answers
2k 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),...
7
votes
1answer
950 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
61 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 ...
4
votes
0answers
664 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
208 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> ...
6
votes
3answers
1k 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
43 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
313 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
539 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
229 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 ...