Questions tagged [tab-completion]

Most shells provide tab completion where a user can type part of a command or file name, and then press tab to make the shell complete the command. This saves greatly on the number of key presses needed when working on the command line.

359 questions
1
vote
1 answer

Tab autocomplete path vim

Is there a way to auto complete a path in vim as in /v [tab] -> /var/ in the command line I've tested ctrl x ctrl f, but it is not exactly what I'm looking for
Nero
  • 21
  • 1
  • 3
1
vote
4 answers

TAB completion and mc problems

DISTRIB_ID=Ubuntu DISTRIB_RELEASE=8.10 DISTRIB_CODENAME=intrepid DISTRIB_DESCRIPTION="Ubuntu 8.10" This is the server version. When I ssh into it, I encounter the following problems: Problem 1 tab completion behaves weird to the point of being…
Mamut
  • 1,040
  • 2
  • 12
  • 23
1
vote
2 answers

shell tab-completion of strings based on more than just the first characters?

Are there any shells which support tab-completion of strings based on more than just the first characters? For example, say I have the branch add_page_to_site, when I do git checkout si[TAB], it expands to git checkout add_page_to_site. Are there…
Suan
  • 34,563
  • 13
  • 47
  • 61
1
vote
1 answer

zsh: completion menu. How to place common part of names?

I have completion menu configured in my zsh. It works great, no problem. Now I want to make my zsh act like that: Let's say there are 3 files in a directory: somefile_first somefile_second somefile_third Now when I press [TAB], I get completion…
blackst0ne
  • 681
  • 6
  • 22
1
vote
2 answers

Bash Autocomplete Ubuntu list all rather than cycle

On a fresh Ubuntu 12.04 install, my terminal tab-complete settings are configured such that the options are cycled through upon the second tab rather than what I am used to (listing all options and only completing what can be determined) For…
asolanki
  • 37
  • 1
  • 7
0
votes
0 answers

Cannot use tab-completion for VS Code in zsh on Ubuntu 23.04 - tries to evaluate instead of suggesting paths to files

I am using VS Code as my primary text editor, which I can launch from a terminal with code. With bash, I can use code in order to generate a list of directories & files for opening a new VS Code session in. However, when I am trying on my…
0
votes
1 answer

Why does just adding strings to COMPREPLY result into tab completion not matching correctly?

I am currently working on a path shortcut manager CLI, which enables users to abbreviate paths with short labels. To make those labels easy to use, I wanted my custom bash commands to autocomplete the labels by pressing tab. This is the broad…
noahpy
  • 3
  • 1
0
votes
0 answers

Zsh _normal completion inconsistent

I've got a completion function which at some point is supposed to revert to completing another command. Think sudo another_command style. ... case $subcommand in (exec) _arguments -S -C \ '(-p…
viraptor
  • 33,322
  • 10
  • 107
  • 191
0
votes
1 answer

How to make a PowerShell argument completer that only suggests files not already selected?

I'm not sure if it's possible to do this so going to first explain what I want to happen. my PowerShell module function has this parameter [ValidateScript({ Test-Path $_ -PathType Leaf })][ValidatePattern("\.xml$")][parameter(Mandatory =…
0
votes
0 answers

Is there a way to reproduce zsh tab completion with readline

As the post subject’s says, I want to know if there is a way with GNU readline library in C to reproduce the colored background like zsh does when pressing tab key. I want to add this feature for the shell, I am currently working on.
dieri
  • 23
  • 6
0
votes
1 answer

"show-all-if-ambiguous" produces ^X and not intended output

I am trying to get "glob-expand-word" to work pi@raspberrypi:~ $ cat .inputrc set editing-mode vi set keymap vi set show-all-if-ambiguous on Control-o: "> output" pi@raspberrypi:~/tmp/test4 $ ls total 8.0K drwxr-xr-x 10 pi pi 4.0K Jan 27 08:48…
dewijones92
  • 1,319
  • 2
  • 24
  • 45
0
votes
0 answers

Is there a ways for zsh completion to ignore multiple command prefixes?

I'm trying to add zsh completions for some aliases which are prefixed by a command and some args. More specifically, I have some commands which are aliased to an envchain ENV_NAME prefix. For example: alias brew='envchain homebrew-credentials brew'…
Calin Don
  • 865
  • 2
  • 11
  • 19
0
votes
1 answer

fish shell completions keep-order

How do I use --keep-order ? My function looks like this: function filterfile -a file -a word grep -i $word $file grep -iv $word $file | sponge $file end and my completions look like this: complete -k -c filterfile --require-parameter…
jaksco
  • 423
  • 7
  • 18
0
votes
0 answers

Tab completion in mandatory parameter

I'm probably missing something very obvious since I hadn't come across this question or an answer...but is it possible to allow for tab completion when a user is prompted to enter a mandatory parameter value, when they forgot to include the…
Nvlddmkm
  • 31
  • 5
0
votes
0 answers

Double completion in BASH complete function

I am trying to invoke bash completion twice for a script. The first completion will be a user pre-filtered by grep, the second is a directory. I wrote a small simplified test script. I managed to get the user completion, but not the second…