Fails to suggest past first word #109
I now tried it with the other plugins disabled. Same problem: it will autosuggest the first word, but no further.
Same problem even if i have no plugin (I'm using zsh 5.0.8 (x86_64-apple-darwin15.0))
My .zshrc configuration is
source ~/.zplug/zplug
# zplug "plugins/brew", from:oh-my-zsh
# zplug "plugins/brew-cask", from:oh-my-zsh
# zplug "plugins/osx", from:oh-my-zsh
# zplug "plugins/pod", from:oh-my-zsh
#
# zplug "plugins/scala", from:oh-my-zsh
# zplug "plugins/sbt", from:oh-my-zsh
# zplug "plugins/npm", from:oh-my-zsh
# zplug "plugins/nvm", from:oh-my-zsh
# zplug "plugins/pyenv", from:oh-my-zsh
# zplug "plugins/pip", from:oh-my-zsh
#
# zplug "plugins/git", from:oh-my-zsh
# zplug "plugins/git-flow", from:oh-my-zsh
# zplug "plugins/git-extras", from:oh-my-zsh
#
# zplug "plugins/command-not-found", from:oh-my-zsh
# zplug "plugins/fasd", from:oh-my-zsh
# zplug "plugins/tmux", from:oh-my-zsh
# zplug "plugins/tmuxinator", from:oh-my-zsh
# zplug "plugins/history-peco", from:oh-my-zsh
# zplug "plugins/common-aliases", from:oh-my-zsh
# zplug "plugins/web-search", from:oh-my-zsh
#
# zplug "zsh-users/zsh-completions"
# zplug "b4b4r07/enhancd", of:enhancd.sh
# zplug "supercrabtree/k"
zplug "tarruda/zsh-autosuggestions", of:"dist/autosuggestions.zsh"
# export ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=243"
# zplug "zsh-users/zsh-history-substring-search", nice:18
# zplug "jimmijj/zsh-syntax-highlighting", nice:19
zplug load --verbose
if zplug check tarruda/zsh-autosuggestions; then
ZSH_AUTOSUGGEST_CLEAR_WIDGETS+=(history-substring-search-up history-substring-search-down) # Add history-substring-search-* widgets t
ZSH_AUTOSUGGEST_CLEAR_WIDGETS=("${(@)ZSH_AUTOSUGGEST_CLEAR_WIDGETS:#(up|down)-line-or-history}") # Remove *-line-or-history widgets f
autosuggest_start # Enable autosuggestions
fi
bindkey '^ ' autosuggest-accept
I'm not familiar with zplug. Can you confirm you still have the problem with a more minimal configuration?
Try installing with:
$ git clone git://github.com/tarruda/zsh-autosuggestions ~/.zsh/zsh-autosuggestionsand confirming you have the latest version:
$ git -C ~/.zsh/zsh-autosuggestions rev-parse --short HEAD
011f542and using the following .zshrc:
source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zshThen start a new terminal session and confirm the problem persists.
It seems to work for me with the most simple setup (start zsh -f and source the plugin manually), but not with my regular setup, even with other plugins disabled. I'll have to do a bit more investigation to get a minimal reproducer.
I'll have to do a bit more investigation to get a minimal reproducer.
That would be very helpful. Thanks!
Here's the minimal reproducer:
$ zsh -f
% setopt sh_word_split
% source zsh-autosuggestions.zsh Then type "source" (with the trailing space), to autosuggest the previous command, and you should see this:
% source sourceThe sh_word_split tells to zsh to expand parameters the same way that bash does. It looks like you ought to add some quotes round variable parameters in your script somewhere.
I still see the problem??
$ git describe --tags
v0.2.8
$ zsh -f
% source zsh-autosuggestions.zsh
% setopt sh_word_split
% source source
I'm sure it used to continue to find suggestions after I typed the command name and got into the options, but no longer.
Now, as soon as I press space, it somehow duplicates the command at the end of the line, and refuses to suggest anything useful. Pressing up does suggest what I'm looking for (presumably that's history-substring-search though).
I'm using zsh-syntax-highlighting and zsh-history-substring-search, but I've followed all the directions in the README.