-bash:autoload: command not found
-bash: /Users/*******/.oh-my-zsh/oh-my-zsh.sh: line 31: syntax error near unexpected token `('
-bash: /Users/*******/.oh-my-zsh/oh-my-zsh.sh: line 31: `for config_file ($ZSH/lib/*.zsh); do'
-bash: zmodload: command not found
-bash: /completion-client.zsh: No such file or directory
-bash: autoload: command not found
-bash: /Users/*******/.zsh/zsh-autosuggestions/autosuggestions.zsh: line 28: syntax error near unexpected token `}'-bash: /Users/*******/.zsh/zsh-autosuggestions/autosuggestions.zsh: line 28: `}'
-bash: zle: command not found
1、Clone this repository into $ZSH_CUSTOM/plugins (by default ~/.oh-my-zsh/custom/plugins)
git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
Add the plugin to the list of plugins for Oh My Zsh to load:
2、把下面这句话添加~/.zshrc文件中
plugins=(zsh-autosuggestions)
-bash: zle: command not found
-bash: zsh-autosuggestions.zsh: line 126: syntax error near unexpected token (' -bash: zsh-autosuggestions.zsh: line 126: user:zsh_autosuggest(bound|orig)_*);;'
报这个错是怎么回事??有碰到的么?怎么解决?
You are sourcing your .zshrc from Bash. Please note that OMZ is a collection of plugins made for zsh, which is not the same shell as Bash.
You can simply use the zsh command to launch zsh from Bash. Alternatively, you can definitely set your user shell to zsh with chsh -s /bin/zsh — then just open a new terminal to launch zsh.
source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
-bash: autoload: command not found
-bash: zmodload: command not found
-bash: /Users/kaodao/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh: line 169: syntax error near unexpected token (' -bash: /Users/kaodao/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh: line 169: user:zsh_autosuggest(bound|orig)_*);;’
local widget=$1local autosuggest_action=$2local prefix=$ZSH_AUTOSUGGEST_ORIGINAL_WIDGET_PREFIXlocal -i bind_count
# Save a reference to the original widgetcase$widgets[$widget] in# Already bound
user:_zsh_autosuggest_(bound|orig)_*);;
# User-defined widget
user:*)
_zsh_autosuggest_incr_bind_count $widgetzle -N $prefix${bind_count}-$widget${widgets[$widget]#*:}
;;
# Built-in widgetbuiltin)
_zsh_autosuggest_incr_bind_count $widgeteval"_zsh_autosuggest_orig_${(q)widget}() { zle .${(q)widget} }"zle -N $prefix${bind_count}-$widget _zsh_autosuggest_orig_$widget
;;
# Completion widget
completion:*)
_zsh_autosuggest_incr_bind_count $widgeteval"zle -C $prefix${bind_count}-${(q)widget}${${(s.:.)widgets[$widget]}[2,3]}"
;;
esac
_zsh_autosuggest_get_bind_count $widget# Pass the original widget's name explicitly into the autosuggest# function. Use this passed in widget name to call the original# widget instead of relying on the $WIDGET variable being set# correctly. $WIDGET cannot be trusted because other plugins call# zle without the `-w` flag (e.g. `zle self-insert` instead of# `zle self-insert -w`).eval"_zsh_autosuggest_bound_${bind_count}_${(q)widget}() {
_zsh_autosuggest_widget_$autosuggest_action$prefix$bind_count-${(q)widget} \$@
}"# Create the bound widgetzle -N $widget _zsh_autosuggest_bound_${bind_count}_$widget