-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
conflict with zsh-autosuggestions & zsh-syntax-highlighting #8
Comments
Thanks for this bug report! I am not familiar zsh-autosuggestions, but it appears to work OK for me. I tried a .zshrc with just:
And it seems to work as expected: Can you please try the latest ZSH version and a simple test .zshrc? And then gradually add back things to your .zshrc until you can identify what causes the problem? Then please describe the conflict you are getting, exact error message or exact behavior. Please include a screenshot if it would be illuminating. |
Hi, I'm also seeing this with similar configuration to @commiyou. From the screenshot I can deduce @commiyou is using oh-my-zsh to load plugins (so am I). I have only observed a conflict with zsh-autosuggestions so far. My .zshrc (with oh-my-zsh installed) is: plugins=(zsh-vim-mode zsh-syntax-highlighting zsh-autosuggestions)
source $ZSH/oh-my-zsh.sh After reading this I was inclined to put My repro is:
I also discovered a workaround, it seems this autosuggestion highlighting issue doesn't happen if I load plugins=(zsh-syntax-highlighting zsh-autosuggestions zsh-vim-mode) |
I have also noticed that the highlighting on |
diff --git a/zsh/plugins/keybindings.plugin.zsh b/zsh/plugins/keybindings.plugin.zsh index f6cfc53..2446644 100644 --- a/zsh/plugins/keybindings.plugin.zsh +++ b/zsh/plugins/keybindings.plugin.zsh @@ -1,5 +1,8 @@ typeset -A key +# Make Vi mode transitions faster (KEYTIMEOUT is in hundredths of a second) +export KEYTIMEOUT=1 + key[Home]=${terminfo[khome]} key[End]=${terminfo[kend]} @@ -34,3 +37,12 @@ bindkey -v # see: softmoth/zsh-vim-mode#8 # zplugin load softmoth/zsh-vim-mode +# Beginning search with arrow keys +autoload -U up-line-or-beginning-search +autoload -U down-line-or-beginning-search +zle -N up-line-or-beginning-search +zle -N down-line-or-beginning-search +bindkey "^[OA" up-line-or-beginning-search +bindkey "^[OB" down-line-or-beginning-search +bindkey -M vicmd "k" up-line-or-beginning-search +bindkey -M vicmd "j" down-line-or-beginning-search diff --git a/zsh/zplugins.zsh b/zsh/zplugins.zsh index fd3702c..bab2b68 100644 --- a/zsh/zplugins.zsh +++ b/zsh/zplugins.zsh @@ -22,8 +22,9 @@ zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}' # scripts # ------- # ==> prettyping -zplugin ice as"program" cp"prettyping -> ping" pick"prettyping" -zplugin snippet https://github.com/denilsonsa/prettyping/raw/master/prettyping +zplugin ice as"program" pick"prettyping" +zplugin load "denilsonsa/prettyping" +alias ping=prettyping # ==> httpstat zplugin ice as"program" cp"httpstat.sh -> httpstat" pick"httpstat" @@ -34,18 +35,17 @@ zplugin ice as"program" pick"diff-so-fancy" zplugin load "so-fancy/diff-so-fancy" # ==> git-now -zplugin ice wait"2" lucid as"program" pick"$ZPFX/bin/git-now" make"prefix=$ZPFX install" +zplugin ice as"program" pick"$ZPFX/bin/git-*" make"prefix=$ZPFX" zplugin load iwata/git-now # ==> git extras -zplugin ice wait"2" lucid as"program" pick"$ZPFX/bin/git-alias" make"PREFIX=$ZPFX" nocompile -zplugin load tj/git-extras -zplugin ice wait"2" lucid pick"etc/git-extras-completion.zsh" +zplugin ice as"program" make"PREFIX=$ZPFX" pick"$ZPFX/bin/git-*" zplugin load tj/git-extras +source "${ZPLGM[HOME_DIR]}/plugins/tj---git-extras/etc/git-extras-completion.zsh" + +# zplugin ice as"program" make"PREFIX=$ZPFX" pick"$ZPFX/bin/git-*" +# zplugin load tj/git-extras -# docker-machine-port-forwarder -zplugin ice as"program" pick"pf" -zplugin load "johanhaleby/docker-machine-port-forwarder" # ------------- # basic plugins @@ -102,9 +102,10 @@ export FZF_DEFAULT_OPTS='--preview "[[ $(file --mime {}) =~ binary ]] && echo {} is a binary file || (bat --color=\"always\" {} || cat {}) 2> /dev/null | head -500"' export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" -zplugin snippet "https://raw.githubusercontent.com/junegunn/fzf/master/shell/completion.zsh" -zplugin snippet "https://raw.githubusercontent.com/junegunn/fzf/master/shell/key-bindings.zsh" -zplugin ice from"gh-r" as"program"; zplugin load junegunn/fzf-bin +zplugin ice from"gh-r" as"program" +zplugin load junegunn/fzf-bin +zplugin ice multisrc'shell/{completion,key-bindings}.zsh' +zplugin load junegunn/fzf # ==> History Search Multi-Word # set reset-prompt-protect to be able to use zle reset-prompt in your e.g. @@ -136,6 +137,18 @@ zplugin load "zsh-users/zsh-completions" zplugin ice blockf zplugin load qubidt/emoji-cli +# ==> zsh-autosuggestions +# Autosuggestions uses precmd hook that is called right after processing +# zshrc (before prompt). Turbo Mode will wait 1 second so precmd will be +# called earlier than load of the plugin. This makes autosuggestions +# inactive at first prompt. But the given atload Ice-mod fixes this, it +# calls the same function precmd would, right after loading autosuggestions +# not working yet, conflicts with history serach +# see https://github.com/zdharma/zplugin/issues/69 +# bindkey '^\n' autosuggest-execute +zplugin ice lucid atload'_zsh_autosuggest_start; bindkey "^ " autosuggest-execute' # load after fast-syntax-highlighting +zplugin load zsh-users/zsh-autosuggestions + # ==> Syntax Highlighting # If you load completions using wait'' mode then you can add # atinit'zpcompinit' to syntax-highlighting plugin (which should be the last @@ -148,18 +161,6 @@ zplugin load qubidt/emoji-cli # ZPLGM[COMPINIT_OPTS]=-C skips compaudit (audit the fpath to assure that it # contains all the directories needed by the completion system, and that # those directories are at least unlikely to contain dangerous files) -zplugin ice wait"1" lucid atload"zpcompinit; zpcdreplay" +zplugin ice lucid atload"zpcompinit; zpcdreplay" zplugin load "zdharma/fast-syntax-highlighting" -# ==> zsh-autosuggestions -# Autosuggestions uses precmd hook that is called right after processing -# zshrc (before prompt). Turbo Mode will wait 1 second so precmd will be -# called earlier than load of the plugin. This makes autosuggestions -# inactive at first prompt. But the given atload Ice-mod fixes this, it -# calls the same function precmd would, right after loading autosuggestions -# not working yet, conflicts with history serach -# see https://github.com/zdharma/zplugin/issues/69 -# bindkey '^\n' autosuggest-execute -zplugin ice wait'0' lucid atload'_zsh_autosuggest_start; bindkey "^ " autosuggest-execute' # load after fast-syntax-highlighting -zplugin load zsh-users/zsh-autosuggestions - diff --git a/zsh/zshrc b/zsh/zshrc index 40037b7..7a78e55 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -63,8 +63,6 @@ fi # ------------ # ==> correct commands setopt CORRECT -# ==> Make Vi mode transitions faster (KEYTIMEOUT is in hundredths of a second) -export KEYTIMEOUT=1 # ==> General settings # from zim:modules/environment
same as me |
I'm sorry for the long delay on fixing this. It looks like it is a conflict between the newish (zsh 5.3) But even setting that hook to If you don't care about zsh-vim-mode's |
I should mention that ordering the plugins like this seems to work fully:
|
I got the same requirement of loading sequence as above after trial and error. But when I enable another plugin adding I guess we need to make sure all widgets enabled by |
1. Separate widgets into files. 2. Load ZLE widget with `add-zle-hook-widget`, which make it possible multiple widgets work at the same work without wrapping each other. Using `add-zle-hook-widget` has one problem. Current highlighting pluings `zsh-syntax-highlighting` and `fast-syntax-highlighting` are not compatible with this method. Make sure widgets enabled by `add-zle-hook-widget` are loaded after these highlighting pluigns. Related issue: softmoth/zsh-vim-mode#8
1. Separate widgets into files. 2. Load ZLE widget with `add-zle-hook-widget`, which make it possible multiple widgets work at the same work without wrapping each other. Using `add-zle-hook-widget` has one problem. Current highlighting pluings `zsh-syntax-highlighting` and `fast-syntax-highlighting` are not compatible with this method. Make sure widgets enabled by `add-zle-hook-widget` are loaded after these highlighting pluigns. Related issue: softmoth/zsh-vim-mode#8
Seems to be all resolved for me! Thanks. |
No description provided.
The text was updated successfully, but these errors were encountered: