7

I love Zsh's tab completions, but it's frustrating when there is only one possible option and I have to tab twice to tab complete the filename.

For example, if this is a list of files in a directory:

- a.txt
- b.txt
- x.txt

and I type cat x<TAB> in ZSH, I get this at the prompt:

$ cat x
x.txt

I have to TAB again to get the value. What can I do to get ZSH to complete the filename with only the first tab?

Here's my setopt:

alwaystoend
autocd
autonamedirs
autopushd
cdablevars
completeinword
correctall
extendedhistory
noflowcontrol
histexpiredupsfirst
histignoredups
histignorespace
histverify
incappendhistory
interactive
longlistjobs
menucomplete
monitor
promptsubst
pushdignoredups
sharehistory
shinstdin
zle
7

The setting I needed to fix was

zstyle '*' single-ignored show

in the completion.zsh file in oh-my-zsh. I changed it to

zstyle '*' single-ignored complete

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.