Questions tagged [zsh-completion]

Questions about command completion in the zsh Unix shell.

Questions about command completion in the Unix shell.

Resources

243 questions
2
votes
0 answers

zsh git completion offers different parameters then current prefix

Typing in zsh % git diff --ca offers --cached -1 -3 -C -M -R -U -l -q -w -0 -2 -B -G -O -S -b -p -u …
hasan
  • 638
  • 4
  • 14
2
votes
2 answers

Case insensitive completion for git in zsh

I have zsh setup to do case insensitive completion but somehow file matching for git completion remains case sensitive: % zsh -f % autoload -U compinit && compinit % zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=*…
Francisco
  • 3,980
  • 1
  • 23
  • 27
2
votes
1 answer

Zsh: Smart autocompletion feature?

I have the following alias in my ~/.zshrc: ~ which pulseaudio-restart pulseaudio-restart: aliased to killall pulseaudio && pulseaudio --start Is it possible to configure Zsh in a way that typing restart will output me pulseaudio-restart as a…
orschiro
  • 19,847
  • 19
  • 64
  • 95
2
votes
1 answer

how to patch git completion that is missing the difftool command

My system's git autocompletion is pretty good, but lacks completion of at least git difftool and git diffmerge. I mean that if I type git diff on my prompt what I get is the following: $ g diff diff -- show changes between commits,…
Ernesto
  • 3,837
  • 6
  • 35
  • 56
2
votes
1 answer

Passing the current commandline to a zsh autocomplete function

I track my billable hours. Every item has a description and a number of tags for different clients, projects etc. Recently I added zsh completion for these tags. This is what I have in my zsh autocompletion file now: _arguments "*:tags:( $(cat…
oivvio
  • 3,026
  • 1
  • 34
  • 41
2
votes
1 answer

Square brackets in zsh completion function argument description, possible?

Basically, I'm wondering if its possible to do this: #compdef foo _arguments \ '--arg=[Description of --arg [With square brackets in the string!]]' \ without getting an invalid option error due to the nested square brackets? I've tried all…
1
vote
1 answer

Zsh bookmark directories with tab completion?

What I want: cd c/ra completes to ~/code/rails-app and cd c/ shows a list of dirs within ~/code What I currently have: c ra completes to c rails-app if I have a directory ~/code/rails-app and c shows a list of dirs within…
Steve McKinney
  • 3,183
  • 1
  • 23
  • 26
1
vote
0 answers

interactive menu completion inserting common prefix in zsh

In my .zshrc I have autoload -Uz compinit compinit zstyle ':completion:*' menu yes select interactive zstyle ':completion:*' insert-unambiguous yes My desired behavior is the following: suppose I have a folder with fileA.txt, fileB.txt,…
MannyC
  • 288
  • 2
  • 11
1
vote
1 answer

Bash Substring File Completion

Does bash partial/substring file completion similar to what zsh does? That is, instead of requiring the user to enter a prefix of the filename, then tab; the user can also enter a substring of the filename, then tab. Say a directory contains a file…
Nordlöw
  • 11,838
  • 10
  • 52
  • 99
1
vote
0 answers

How to create autocompletion for zsh

I have a simple command with a couple sub commands which I would like to create a zsh code completion script for. I have read many web sites, but very confused. My command (and sub commands) are: stx ls stx clean stx start stx stop How can I create…
Hai Vu
  • 37,849
  • 11
  • 66
  • 93
1
vote
1 answer

how to add a additional completion to the already defined git subcommand completion?

I was experimenting with custom git subcommand completion: I am trying to extend the completion for git commit -m or git commit --message. $HOME/.zsh/completions/_git-foo (this path is added to fpath fpath+=~/.zsh/completions) #compdef…
AK-35
  • 559
  • 2
  • 9
  • 24
1
vote
1 answer

kubectl plugin tab auto complete not working with zsh

After installing kubernetes-cli via homebrew in a mac with zsh, the kubernetes auto complete is not working completely or in full. Only the first tab works and not the second tab onwards. Example, if I type kubectl [TAB], it displays the sub…
Venu
  • 1,513
  • 3
  • 19
  • 37
1
vote
1 answer

ZSH autocomplete function using existing autocompletions

I have a function mycmd to launch a program that I wrote. The program needs the first argument to be foo, ssh or ls. The second argument depends on the first argument as follows, foo -> No second argument ssh -> Something to ssh to ls -> A file I…
Teshan Shanuka J
  • 1,448
  • 2
  • 17
  • 31
1
vote
1 answer

zsh auto completion in home dir

I used for years in openSuSE the: #compdef w _files -W ~/work -/ function to auto-complete the directory names in my ~/work dir. It does not work in Ubuntu zsh -v 4.3.11, when I hit TAB after w I got directories from my home directory. What's…
kfl62
  • 2,434
  • 4
  • 29
  • 40
1
vote
0 answers

Zsh completion with fzf-tab doesn't work with dotnet command

I enabled zsh completion and added fzf-tab via zinit. It works as expected. I added some custom/extra completions e.g., aws cli and it also worked as expected. However, when I tried to enable the completion for dotnet as recommended it didn't work…