diff --git a/abbr b/abbr index ac127249..9c9111c7 100755 --- a/abbr +++ b/abbr @@ -64,16 +64,9 @@ function abbr_expand() { } function abbr_expand_accept() { - local lbuffer=$LBUFFER - local rbuffer=$RBUFFER - - RBUFFER=$rbuffer # clear suggestions for the abbreviation abbr_expand - RBUFFER=$rbuffer # clear suggestions for the expanded command - - # if [[ $lbuffer == $LBUFFER ]]; then - zle accept-line - # fi + zle autosuggest-clear # play nice with zsh-autosuggestions + zle accept-line } function abbr_expand_space() { @@ -102,8 +95,7 @@ bindkey "^ " magic-space bindkey -M isearch "^ " abbr_expand_space bindkey -M isearch " " magic-space -# return expands and accepts abbreviations -# NOTE: will clear anything after the cursor!! +# enter key expands and accepts abbreviations zle -N abbr_expand_accept bindkey "^M" abbr_expand_accept