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

How do I get zsh completion to match from the middle of a filename ignoring case?

I am having difficulty getting zsh to autocomplete the way that I would like it to. Ideally, I would like type some string (that could be a single character), and after hitting tab, get a list of every file and directory that has that string in it,…
beninato
  • 420
  • 5
  • 15
1
vote
1 answer

zsh completion with nested control functions

I'm writing completion function for zsh. I took cargo completion function as a basis for mine. For the most part it works fine except for -h and --help options. Completion ouput for these functions is unaligned and repeated multiple times (presented…
Sergey
  • 1,166
  • 14
  • 27
1
vote
1 answer

"command not found" on tab completion for "bat" in zsh

Normally, when I use tab complete for a program that doesn't have completion defined, it will just default to completing on files. However, with the bat command I get something that looks like this: 1010 ⮚ bat (eval):1: command not found:…
Thayne
  • 6,619
  • 2
  • 42
  • 67
1
vote
0 answers

How can I get zsh completion to expand environment variables like bash does?

When using bash, if I have an environment variable called SOMEPATH which contains a path (e.g. SOMEPATH=/usr/local/lib), then if I type ls $SOMEPATH/ and hit tab then bash expands the environment variable so my command line now says ls…
Chris J
  • 81
  • 5
1
vote
0 answers

ZSH How to bind unicode character?

My keyboard layout is very similar to classic latin but with some extra characters like ç, ş, ö, ü, ğ, İ. I wanted to bind these chars in zsh like “bindkey “^Ş” autosuggest-accept” how can I do that?
1
vote
0 answers

zsh: override builtin function

The answers given in Disable auto-completion of remote branches in Zsh? no longer work, as zsh has changed the way it does this in the last six years. I've hacked up a version of the __git_refs function which does not list remotes, and stored the…
John Y
  • 1,161
  • 12
  • 23
1
vote
1 answer

Autocompletion for my shell function, using oh-my-zsh

I have a shell function that lets me quickly cd to a project: p() { cd "$HOME/projects/$1" } However, it isn't very useful without autocomplete. I'm using oh-my-zsh, any idea how best to add oh-my-zsh's standard cd autocomplete to my function p?
yashap
  • 45
  • 5
1
vote
1 answer

Zsh in iTerm2 completion causing git push error

I am using Zsh with iTerm2 and trying to follow these instructions to remove a commit that I accidentally pushed to a repo (don't worry, it doesn't have any followers other than me). Running the command git push -f origin HEAD^:develop causes an…
pillravi
  • 4,035
  • 5
  • 19
  • 33
1
vote
1 answer

Zsh completion case insensitive _multi_parts function

I have a script that takes file like arguments (multi part arguments), I am fetching the possible values and putting them in an array called raw and then using _multi_parts / "(${raw[@]})" to autocomplete. The problem is that this is case…
Ross MacArthur
  • 4,735
  • 1
  • 24
  • 36
1
vote
1 answer

fish autocomplete file path without specifying directory structure

I recently switched over to fish shell and want to know whether it can autocomplete file paths as in zsh without specifying it's parent directories. For a file in foo/bar/file.ext, in zsh, I can type open .///file and autocomplete to open…
Chris
  • 78
  • 7
1
vote
1 answer

Restrict zsh tab completion behavior

My zsh has some completion features I don't understand and can't find where to change. I have two issues where I suspect they have a similar "fix" for my problem. I initialize the zsh completion system with autoload -Uz compinit compinit to get…
skaphle
  • 26
  • 6
1
vote
2 answers

zsh autocompletion, second parameter based on first

I need to auto-complete two parameters of a function, where the second parameter depends on the first one. An example: the first parameter of a function "foo" can have values of "a" or "b". The second parameter can have values "10" or "11" in case…
Jakub M.
  • 32,471
  • 48
  • 110
  • 179
1
vote
1 answer

Oh my zsh - exclude widgets from completion results

I'm really like AUTOCD option in zsh but widget names make it less comfortable in use. The problem is when I'm e.g. in my home directory, type "down" and press Tab I would expect completion for "Downloads" but on the first place in auto-completion…
Tomasz Bakula
  • 161
  • 1
  • 7
1
vote
1 answer

Using bash function + grc like an alias breaks Zsh completion

I'm using grc / grcat to colorize my terminal output with this function: function docker() { case $* in ps* ) shift 1; command docker ps "$@" | grcat $HOME/.grc/conf.dockerps ;; images* ) shift 1; command docker images "$@" | grcat…
Rogério Peixoto
  • 2,176
  • 2
  • 23
  • 31
1
vote
0 answers

ZSH completion: show folders first

How to give the highest priority to the folders group on tab complete? Right now, during the completion (no cd in front), almost everything is placed before folder names, so it's a bit of annoying to iterate through system commands, functions, etc.…
Ghedeon
  • 1,643
  • 1
  • 18
  • 30