zsh-users / fizsh

Friendly Interactive ZSHell.
Other
301 stars 18 forks source link

autosuggestion support #7

Closed dontdieych closed 9 years ago

dontdieych commented 9 years ago

are you plan to support auto suggestion?

guidovansteen commented 9 years ago

Thanks for your suggestion. I modelled fizsh after fish version 1.23.1. If I remember correctly, this version of fish did not have autosuggestions.

This being said, autosuggestion for zsh is currently provided by https://github.com/tarruda/zsh-autosuggestions. It seems that Tarruda's package works fine with fizsh after loading it at the end of ~/.fizsh/.fizshrc.

I have never thought of packaging zsh-autosuggestions as a part of fizsh, but it could be worth considering. Or at least I could provide some instructions on how to add zsh-autosuggestions in such a way that it works with fizsh.

guidovansteen commented 9 years ago

The main file of https://github.com/tarruda/zsh-autosuggestions is called "autosuggestions.zsh". In this file the fragment

ZLE_AUTOSUGGEST_COMPLETION_WIDGETS=( complete-word expand-or-complete expand-or-complete-prefix list-choices menu-complete reverse-menu-complete menu-expand-or-complete menu-select accept-and-menu-complete )

yields an error when autocompletion is invoked within fizsh. In fizsh tab is bound to the widget _fizsh-expand-or-complete-and-highlight (and not to expand-or-complete). This is to address https://github.com/zsh-users/zsh-syntax-highlighting/issues/102.

Autocompletion seems to work when the above fragment is changed into:

ZLE_AUTOSUGGEST_COMPLETION_WIDGETS=( complete-word _fizsh-expand-or-complete-and-highlight expand-or-complete-prefix list-choices menu-complete reverse-menu-complete menu-expand-or-complete menu-select accept-and-menu-complete )

dontdieych commented 9 years ago

Thanks for explanation. I'll give a shot.

Thanks.

nift4 commented 4 years ago

The main file of https://github.com/tarruda/zsh-autosuggestions is called "autosuggestions.zsh". In this file the fragment

ZLE_AUTOSUGGEST_COMPLETION_WIDGETS=( complete-word expand-or-complete expand-or-complete-prefix list-choices menu-complete reverse-menu-complete menu-expand-or-complete menu-select accept-and-menu-complete )

yields an error when autocompletion is invoked within fizsh. In fizsh tab is bound to the widget _fizsh-expand-or-complete-and-highlight (and not to expand-or-complete). This is to address zsh-users/zsh-syntax-highlighting#102.

Autocompletion seems to work when the above fragment is changed into:

ZLE_AUTOSUGGEST_COMPLETION_WIDGETS=( complete-word _fizsh-expand-or-complete-and-highlight expand-or-complete-prefix list-choices menu-complete reverse-menu-complete menu-expand-or-complete menu-select accept-and-menu-complete )

That is now broken. Could you maybe post an new solution?