Question

I am using zsh and iTerm2. I always use the Tab-key when i want to autocomplete the command. But if there is no command to be autocompleted, the cursor will move forward which is not what i want.

So is there a way to disable the cursor that moves forward when no command can be autocompeleted, thanks.

Était-ce utile?

La solution

The behaviour of Tab on an empty line can be configured by the zstyle insert-tab:

zstyle ':completion:*' insert-tab <VAL>

where <VAL> can be

  • true [default]: insert TAB character
  • false: perform completion (completion list contains all commands)
  • pending or pending=val: insert TAB character IF there is unprocessed input (pasting text), otherwise perform completion

So if you don't want it to insert a TAB, you can set it to false:

zstyle ':completion:*' insert-tab false
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top