Questions tagged [zsh-completion]

Questions about command completion in the zsh Unix shell.

Questions about command completion in the Unix shell.

Resources

243 questions
5
votes
1 answer

zsh: Force single tab completion

I recently switched from bash to zsh. How can I achieve the following tab completion behavior: Enter the first letters, then press TAB. Complete the entry until the first ambiguous letter and immediately show the options / alternatives. Currently,…
matthjes
  • 671
  • 7
  • 20
5
votes
1 answer

Zsh autocomplete function based on 2 arguments

I have a function like this: p() { cd ~/Clients/$1/Projects/$2; } Then I can type: p "Client here" "Project here" and it takes me to: ~/Clients/Client here/Projects/Project here Nothing special going on here. But how do I implement autocomplete…
agronemann
  • 687
  • 4
  • 16
4
votes
1 answer

adding new zshell command line custom git completions

I installed git via Homebrew. I get command line completions via the script installed in /usr/local/etc/bash_completion.d/ However I want my custom git-* scripts to be completed too. How would I tack this on to existing git completions?
Surya
  • 4,922
  • 8
  • 41
  • 54
4
votes
2 answers

command not found: __start_kubectl

I installed kubectl and tried enable shell autocompletion for zsh. When I'm using kubectl autocompletion works fine. Howewer when I'm trying use autocompletion with alias k then shell return me k g...(eval):1: command not found: __start_kubectl …
Dawid Krok
  • 61
  • 1
  • 3
4
votes
1 answer

How can I get zsh to inherit the complete autocompletion?

I have an little shell script (named "run") which redirects all output of a program to /dev/null: #!/bin/bash $@ &> /dev/null & disown + How can I say zsh that the whole autocompletion shall work for this? I mean $ run git com autocomplete…
zvavybir
  • 1,034
  • 6
  • 15
4
votes
1 answer

Oh My ZSH Docker Autocompletion on OSX not working

I cant seem to get Docker autocompletion working using Oh My Zsh on macOS I have the following in my .zshrc file plugins=(docker git brew osx) The git, brew and osx autocompletion is working, if I type docker and tab I get a list of files not…
Mike U
  • 2,901
  • 10
  • 32
  • 44
4
votes
4 answers

how to search all history command by using bck-i-search in zsh

I used zsh and when I run Ctrl-R to search history command, I can only get the command executed in this session, but can't search all the history commands. I know there is a .bash_history file in bash to store all the history commands and we can do…
shangyin
  • 526
  • 1
  • 4
  • 14
4
votes
2 answers

how to install kubectl autocompletion plugin for zsh?

I installed ohmyz.sh , on my mac book , i want to install kubectl autocompletion plugin for zsh , but not aware of the steps to install , can any one help on this please ?
Bravo
  • 8,589
  • 14
  • 48
  • 85
4
votes
1 answer

Disable auto-completion of tags in Zsh for git checkout command?

I have a repository with a lot of tags. How can I disable completion to it for git checkout command
Artur Eshenbrener
  • 1,850
  • 2
  • 17
  • 24
4
votes
1 answer

First argument either subcommand or flag with values

I'm writing a zsh completion script for the swift tools (compiler and package manager). This command can be used with or without specifying a subcommand. For example # calls to the compiler # usage: swift [options] 1> swift…
Bouke
  • 11,768
  • 7
  • 68
  • 102
4
votes
1 answer

How do I find out which function is used for zsh tab completion

I want to know which function zsh is using for tab completion of a command. For many commands (make, ls, cd …) I can apparently guess _, but I might actually have overriden this setting with compdef _mycd cd. The reasons why I want to…
pseyfert
  • 3,263
  • 3
  • 21
  • 47
4
votes
1 answer

Custom zsh completion for a function based on default arguments

How can I setup completion for a function, based on existing completion definitions and default arguments. A simplified example (which could be rewritten as an alias): gpl() { git pull origin $@ } This should have the same completion as after…
blueyed
  • 27,102
  • 4
  • 75
  • 71
4
votes
3 answers

Bower runs as Bundler on zsh/oh-my-zsh

Whenever I run bower install or any bower command, it ends up running as bundle install or something else from bundler. I'm running a zsh shell with oh-my-zsh. It works as expected in a bash shell. Example output: % bower install bundle install…
Mike
  • 152
  • 7
4
votes
2 answers

Git alias parameter completion doesn't work in Zsh

I encounter a problem with Zsh autocompletion for some specific git commands (the ones involving a remote and a branch), but only when using aliases. Here is an example with push: $ git push origin master # tab completion works $ git…
aymericbeaumet
  • 6,853
  • 2
  • 37
  • 50
4
votes
2 answers

zsh: show completion group names

I'm writing some zsh completions and am stuck on how to have multiple groups of completions. I added the group name with the -J parameter docs. compadd -J group1 "$@" completion1 completion2 compadd -J group2 "$@" completion3 completion4 Then I…
Ilia Choly
  • 18,070
  • 14
  • 92
  • 160