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.
118
questions
0
votes
0
answers
23
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 ...
1
vote
1
answer
60
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 ...
0
votes
0
answers
185
views
zsh tab-completion does not work for my own /lib/systemd/system services
In my Ubuntu 20.04 focal environment, zsh tab-completion is not working for my own /lib/systemd/system services.
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: ...
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 ...
0
votes
0
answers
46
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
307
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
126
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 ...
1
vote
1
answer
902
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 ...
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 ...
1
vote
1
answer
498
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
0
answers
70
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
1
answer
145
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
1
answer
463
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
1
answer
171
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 ...
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.
...
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 ...
1
vote
1
answer
726
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
1
answer
273
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
1
answer
933
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 ...
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 ...
6
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) ...
4
votes
0
answers
152
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
226
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
238
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
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
...
0
votes
0
answers
44
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 ...
3
votes
2
answers
657
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 ...
1
vote
1
answer
742
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
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 ...
1
vote
0
answers
55
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
0
answers
745
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 ...
48
votes
1
answer
27k
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
1
answer
994
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
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 ...
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 ...
4
votes
1
answer
503
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
1
answer
949
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
1
answer
405
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
1
answer
264
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
1
answer
1k
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 ...
3
votes
1
answer
2k
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
1
answer
553
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
2
answers
649
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
1
answer
991
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
1
answer
78
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
1
answer
3k
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 ...
7
votes
2
answers
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),...
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.
...
0
votes
1
answer
107
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 ...