Questions tagged [zsh-completion]

Questions about command completion in the zsh Unix shell.

Questions about command completion in the Unix shell.

Resources

243 questions
0
votes
1 answer

Unable to have two-word-search in Zsh's TAB completion for Man

Problem: to have a tab completion which takes two words and calculates the best match from them for Man, and then returns the best matches Example: The following pseudo-code should give me at least Zsh's reverse-menu-complete -command. Right now, I…
Léo Léopold Hertz 준영
  • 134,464
  • 179
  • 445
  • 697
0
votes
0 answers

zsh completion for list of possible values of an environment variable

Consider an environment variable that can take a list of arbitrary possible meaningful values. For an example of such an environment variable consider AWS_PROFILE. The list of possible values can be easily computed by some command, e. g. aws…
bagratte
  • 157
  • 2
  • 5
0
votes
0 answers

How to make zsh-autocorrect insert common "prefix" instead of common "substring"?

TLDR How can I configure zsh-autocomplete to insert up to the longest common prefix, excluding their common suffixes? I have not seen this asked before on StackOverflow. Here is a GitHub issue which is related but not the same. Setting up the…
0
votes
0 answers

How does this zsh completion style for environment variables work?

I can across the following zstyle setting in a popular shared zsh configuration: # Environment Variables zstyle ':completion::*:(-command-|export):*' fake-parameters ${${${_comps[(I)-value-*]#*,}%%,*}:#-*-} Source: sorin-ionescu/prezto…
Ankur
  • 2,792
  • 3
  • 23
  • 26
0
votes
0 answers

oh my zsh with git plugin, how to auto completion with filename

my terminal picture In that case,I want add 1.txt ,I must type ga tmp/caches/1.txt, how can i just type ga 1.txt and help me auto complete full file path. I've installed zsh-autosuggestions zsh-completions, but they were helpless. I want some plugin…
robin
  • 1
  • 1
0
votes
0 answers

ZSH Making the completions list appear in a single column instead of multiple columns

How to make the completion list always appear in a single column instead of multiple columns (one item per line, no multiple items on one line).
dwbFrank
  • 115
  • 1
  • 5
0
votes
0 answers

How to write zsh completer for an option which needs to be completed differently depending on its prefix?

I'd like to write completion for a program taking --dsn= option where database specification is of the form backend://something-else and where "backend" can take one of several predefined values, such as postgresql, odbc or…
VZ.
  • 21,740
  • 3
  • 39
  • 42
0
votes
0 answers

How to configure zsh under Windows to complete foo.exe as foo, for any foo?

Is there some simple way to configure zsh to use the same completer for foo.exe as for foo itself for any foo? By default this doesn't seem to happen, and so pressing TAB after git.exe uses the default file completion instead of Git-specific command…
VZ.
  • 21,740
  • 3
  • 39
  • 42
0
votes
1 answer

capture special characters ! in echo command for zsh

I am trying to capture a string in mac terminal zsh when i try echo "abc1234!" It would prompt for dquote> I have tried adding a additional quote like this echo "abc1234!"" Output abc1234 how do i capture ! character in the string ??
nova_rubo
  • 49
  • 1
  • 7
0
votes
0 answers

How to trigger zsh completion with a regular command?

If I type this inside a regular interactive zsh shell that I have prepared with autoload -U compinit && compinit: $ cat -- and then press the Tab key on my keyboard, I get this zsh completion output: $ cat -- --help -- display help and…
Enselic
  • 4,434
  • 2
  • 30
  • 42
0
votes
0 answers

ZSH with OhMyZsh cycle through history when there is no match

Issue I am using ohmyzsh with no changes. Here is my .zshrc file (comments removed for brevity): export ZSH="$HOME/.oh-my-zsh" ZSH_THEME="robbyrussell" plugins=(git) source $ZSH/oh-my-zsh.sh When I use the UP arrow key with a blank terminal…
BitWrecker
  • 174
  • 1
  • 10
0
votes
0 answers

zstyle: changing the description style value of a tag

I use the following zstyle commands to group completion items by their description: zstyle ':completion:*:*:*:*:descriptions' format '%F{green}-- %d --%f' zstyle ':completion:*' group-name '' zstyle ':completion:*:ssh:*:users' users alice bob…
nyg
  • 2,380
  • 3
  • 25
  • 40
0
votes
1 answer

ZSH Equivalent to Bash `_command` completion

Given an example wrapper shell function: app() { setsid "$@" } In Bash, you can do complete -F _command app to automatically give app completions for all commands (not just binaries on the path but also the arguments afterwards). How can you do…
Elliot Killick
  • 389
  • 2
  • 4
  • 12
0
votes
1 answer

`read` command returns immediately instead of waiting for input

I'm trying to make a simple zsh widget that asks user for a string and sets it as the current command prompt afterwards zle -N replace-command-buffer bindkey '\eg' replace-command-buffer replace-command-buffer() { local input echo "Enter a…
Poma
  • 8,174
  • 18
  • 82
  • 144
0
votes
1 answer

ZSH completion matching control : fuzzy match on one part of input

I'm writing a zsh completion for some program, and parts of it involves completing resource routes (/they/look/like/this). I have a command mycmd that I can use to generate some completion candidates of resource routes, and provide completions for…
lsdch
  • 13
  • 4