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
1 answer

Zsh dependent completion with space in arguments

I'm trying to implement completion for a function, where the completion for the second argument depends on the first one. function test_so() { echo "$1" "$2" } function _test_so() { local state _arguments '1: :->arg1' '2: :->arg2' case…
Halil Özgür
  • 15,731
  • 6
  • 49
  • 56
2
votes
1 answer

can't use '~' in zsh autocompletion

I use zsh and I want to use a function I wrote to replace cd. This function gives you the ability to move to a parent directory: $ pwd /a/b/c/d $ cl b $ pwd /a/b You can also move into a subdirectory of a parent directory: $ pwd /a/b/c/d $ cl b/e $…
2
votes
2 answers

Change zsh history color

I'm trying to change the colour of the autocomplete (from history) so that it doesn't match my input color (maybe same color less opacity..). Here's a pic: Is this possible? (I'm using Terminator, if that helps at all..)
Martin
  • 1,159
  • 10
  • 34
2
votes
0 answers

zsh generate autocompletion options from `--help`

My goal is to generate zsh completions for a program I am writing. One option would be to write a lengthy completion file that lists all arguments and options, but since I often add arguments and options I would love zsh to handle the generation of…
Seriously
  • 884
  • 1
  • 11
  • 25
2
votes
1 answer

Zsh with iTerm2 on MacOS with a small pane and a long prompt : space after prompt removed

SOLUTION STILL NOT FOUND : I am faced different prolems with zsh which are not expected on MaOS Catalina/iTerm2. I) Indeed, if I divide for example a big original window of iTerm2 (only once terminal) into 4 panes, and moreover, if I have a long…
user1773603
2
votes
2 answers

compgen:96: command not found: aws_completer when trying to autocomplete aws

I'm trying to get aws-cli autocompletion working in my zsh using oh-my-zsh, fzf, zsh-completion and fzf-tab-completion. But when I hit tab after aws I get the following error: compgen:96:command not found: aws_completer This is my .zshrc: source…
zlZimon
  • 2,334
  • 4
  • 21
  • 51
2
votes
1 answer

How to disable kubectl auto-completions on zsh

How can I disable the kubectl autocompletions functionality on zsh. I'm running on osx and the autocompletions are slow(probably because they have to call the remote cluster API) and I don't want them no more.
martinkaburu
  • 487
  • 6
  • 18
2
votes
0 answers

Is ZSH completion system capable of completing multiple arguments at the same time?

Scenario: Let's say a script my_online_searcher opens a browser with the search for query, where query can be multiple words long. This same script also provides a utility flag -s that shows the search engine's suggestions. E.g.: $…
mr.celo
  • 585
  • 1
  • 5
  • 17
2
votes
1 answer

Select from zsh completion menu by number

I discovered this little navigation trick the other day, which allows me to trigger menu completions by number when I enter 'cd -' ~ cd - 0 -- ~/home 1 -- ~/home/stuff 2 -- ~/downloads 3 -- ~/wallpaper Shell scripting syntax still reads like a…
xoihiox
  • 101
  • 6
2
votes
1 answer

Custom zsh completion: custom sort?

I'm using _values to add completion to a custom zsh command, but unfortunately, zsh ignores the order in which I pass the values and sorts in reverse order of what I what (I want sort -rn, basically). Is there anyway to force it to respect the…
Gal
  • 5,338
  • 5
  • 33
  • 55
2
votes
0 answers

zsh-like autocompletion in ipython

One thing I like about zsh autocompletion is how it handles situation when more than 1 item matches the pattern. Say I have folders: ./ abc/ bbc/ bcd/ In zsh, when I type b and , I can see all the suggestions starting with b (same as in…
sygi
  • 4,557
  • 2
  • 32
  • 54
2
votes
0 answers

Make zsh tab-complete path after colon

To quickly and temporarily append a directory to my PATH environment variable I usually do export PATH=$PATH:/some/other/dir however zsh does not tab-complete the part after the colon typing :/so. Typing export PATH=/so expands to export…
truschival
  • 303
  • 1
  • 2
  • 7
2
votes
1 answer

Never complete beyond ambiguous choices

I'm trying to figure out how to customize zsh completion so that it never completes beyond an ambiguous result by just hitting tab. Here's an example. $ emacs f food fool (completes into) $ emacs foo food fool Importantly, if I press TAB…
Gregory
  • 1,205
  • 10
  • 17
2
votes
0 answers

zsh completion: Do not strip quotes?

When using completion inside a double quoted string, zsh strips the leading ". E.g. export PATH="$HOME/software becomes export PATH=$HOME/software How can I convince zsh that I like the leading double quote and keep it?
georg
  • 755
  • 2
  • 7
  • 13
2
votes
1 answer

Only suggest executables and not directories when typing ./ (dot-slash) in zsh

Here's an example snippet from my current zsh session: llama@llama:...Code/cpp/KingOfTheCode$ make clang++ -std=c++11 -Iinclude src/*.cpp kothsrc/*.cpp -pthread -o KingOfTheCode llama@llama:...Code/cpp/KingOfTheCode$ ./ Completing executable file or…
tckmn
  • 57,719
  • 27
  • 114
  • 156