romkatv / zsh4humans

A turnkey configuration for Zsh
MIT License
1.81k stars 116 forks source link

Single tab to accept auto-suggestion / double tab to bring fzf #215

Closed Quentin-M closed 2 years ago

Quentin-M commented 2 years ago

Dear zsh4humans community,

I have been used for years to have a single TAB auto-complete / accept the current suggestion, and double TAB to present the other choices. The current behavior of zsh4humans's setup is to auto-complete with any cursor moving action (e.g. right arrow), and bring other options (with fzf) with a single TAB press.

I am absolutely noob when it comes to the zsh world and don't expect to be able to sort it out quickly.. Would anyone happen to know could we make a single TAB accept (aka zstyle ':z4h:autosuggestions' tab-char 'accept' ) while keeping the fzf suggestion behavior with double TAB (instead of one)? bindkey '\t' autosuggest-accept obviously doesn't cut it as it will autocomplete with TAB but completely remove the fzf bevavior.

Thanks all!

romkatv commented 2 years ago

Autosuggestions are not the same as completions. From https://github.com/romkatv/zsh4humans/blob/master/README.md:

Zsh for Humans

After echo hello you can see world in grey. This is not a part of the command, so pressing Enter will print only hello but not world. The latter is an autosuggestion provided by zsh-autosuggestions that you can accept in part or in full. It comes from command history and it's a great productivity booster. See zsh-autosuggestions homepage for more information.

Autosuggestions are accepted by moving the cursor up to the point of what you want to accept. So, moving the cursor by one word will accept one word, etc.

zsh4humans doesn't support what you are asking and it's not something I'm eager to implement.