0

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.

ahilsend
  • 931
  • 6
  • 15
Foredoomed
  • 2,219
  • 2
  • 21
  • 39
  • When exactly? When the line is empty (you haven't typed anything yet) or when you type a command that doesn't exist? – ahilsend Jul 25 '13 at 16:24
  • @ahilsend : the former, but when i am typing **cd** command, the Tab key will cause one space after the path – Foredoomed Jul 26 '13 at 06:06

1 Answers1

0

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
ahilsend
  • 931
  • 6
  • 15