Questions tagged [zsh-completion]

Questions about command completion in the zsh Unix shell.

Questions about command completion in the Unix shell.

Resources

243 questions
1
vote
0 answers

zsh completion cache security model broken?

This may be a bug or misfeature in zsh, but I don't know it that well and I may be misunderstanding. compinit (the function that initializes completions) runs compaudit to enforce a security model whereby it will only load completion functions from…
nfirvine
  • 1,479
  • 12
  • 23
1
vote
1 answer

branch name autocompletion for mercurial in zsh

I was very excited about zsh but I occurred a big problem. Autocompletion for hg update doesn't work for me. I did include zsh_completion file (from newest mercurial source) in my .zshrc file like this (after moving to home…
Kayne
  • 47
  • 1
  • 10
1
vote
0 answers

Provide description for zsh completion option?

I'm working on a completion for a shell program I have and I'd like to be able to provide metadata descriptions for the completion For example complete-this f foo - "some description" baz - "some other description" And if "foo" is chosen,…
devshorts
  • 8,572
  • 4
  • 50
  • 73
1
vote
0 answers

ZSH on OSX: cd ~ and ~/ Tab completion issue

Currently using ZSH with prezto on OSX (10.10.3) and I am having issues with the tab completion. I have always been able to hit the tab key after typing either: $ cd ~ $ cd ~/ and I would get a directory menu with the contents of my users home…
YuujM
  • 23
  • 4
1
vote
2 answers

zsh alias taking a list of subdirectories as arguments

My goal is to type client air tab and complete the list of clients i have within my ~/clients directory. Since hopefully my client list will grow i don't want to hardcode alias commands anymore but use client that will handle the cd…
pjammer
  • 9,489
  • 5
  • 46
  • 56
1
vote
2 answers

zsh - first tab completion with autocd

I am currently switching from csh to zsh I am writing a .zshrc trying to get all the options I am used to in this new shell. I use autocd (to go into a directory just typing its name (without the cd command), and I wonder if it is possible that my…
Bast
  • 13
  • 1
  • 5
1
vote
1 answer

Invoke custom function in zsh completion?

I can't seem to figure out a way to call a zsh completion function that I can tap into and provide a return result of available items. For example, I'd like to be able to call out to a web service and return back an array of potentials. I've tried…
devshorts
  • 8,572
  • 4
  • 50
  • 73
1
vote
1 answer

Implementing autocompletion to zsh aliases

I am using the awesome zsh framework oh-my-zsh. Every day I hit gc which is an alias for git commit I hit and it gives me the correct files to commit. I am really interested to know how that is implemented, so I can implement my own idea…
Wazery
  • 15,394
  • 19
  • 63
  • 95
1
vote
1 answer

Holding state in zsh completions

I want to write zsh completions for a program with the following calling convention: program [generaloptions] operation [operationoptions] where operation is one of --install, --upgrade... What I have so far, are the general options and the…
SvenK
  • 2,584
  • 2
  • 21
  • 24
1
vote
1 answer

zsh/bash completion with ruby gem command tool

I created a command line ruby gem and would like to have bash or zsh completion. I created and versionned them, but I have to source them manually. Is there a common way to execute scripts after the gem install, for example to edit the bashrc or…
reaper
  • 398
  • 3
  • 15
1
vote
1 answer

zsh completion: compadd strings with hyphens and spaces

This command works: compadd - '-test1 text' '-test1 qwer' This command works too: compadd -Q - '-test1 text' '-test2 qwer' But if first words are the same, then the command does not works: compadd -Q - '-test1 text' '-test1 qwer' How can I fix it?
Des333
  • 69
  • 1
  • 3
1
vote
0 answers

zsh completion: _arguments not accepting the option '--no-fsck'

I am trying to write a zsh completion function for an internal script, and one of the script's options is --no-fsck. This is the abbreviated version of what i'm doing in the completion file: _arguments \ '--no-fsck[skips e2fsck]' \ && return…
kine
  • 3,451
  • 2
  • 15
  • 8
1
vote
1 answer

Zsh tab completion adds a forward slash for directories, how to avoid this?

Currently I am using zsh and every time I use tab completion for directories it will add a forward slash at the end. This creates a problem when using commands like rsync, which differenciates directory arguments that have a forward-slash. So every…
milarepa
  • 759
  • 9
  • 28
1
vote
2 answers

How can I modify zsh to autocomplete `source` with the local directory before the $PATH?

I can't count the number of times I've typed: source en only to be left with a bunch of garbled text on the screen because it sourced the program env instead of the local env.sh. I tried making a simple function to detect this particular use…
Caustic
  • 475
  • 3
  • 14
0
votes
1 answer

Make zsh completion more bash-like / best practice with zsh completion

Using bash I did like to do something like this: $ l file15165 file23132 file31351 xyzfile $ $CMD f (f gets completed to "file", I type "*", [23] or whatever) $ $CMD file* This way I am sure the command is executed on all the files I…
exic
  • 2,220
  • 1
  • 22
  • 29