From 1cbd78c8502da794fbe2a3780efbc3112e3d8bba Mon Sep 17 00:00:00 2001 From: Mihai Sucan Date: Sun, 23 Feb 2014 22:54:31 +0200 Subject: [PATCH 1/2] add a config for RIGHT arrow to accept the suggestion, like in fish --- autosuggestions.zsh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/autosuggestions.zsh b/autosuggestions.zsh index 34d482a..456b011 100644 --- a/autosuggestions.zsh +++ b/autosuggestions.zsh @@ -32,6 +32,7 @@ vi-cmd-mode vi-backward-char backward-char backward-word beginning-of-line history-search-forward history-search-backward up-line-or-history history-beginning-search-forward history-beginning-search-backward down-line-or-history history-substring-search-up history-substring-search-down +backward-kill-word ) ZLE_AUTOSUGGEST_COMPLETION_WIDGETS=( @@ -234,7 +235,11 @@ autosuggest-tab() { } autosuggest-accept-suggestion() { - zle autosuggest-${WIDGET}-orig "$@" + if [[ AUTOSUGGESTION_ACCEPT_RIGHT_ARROW -eq 1 && "$WIDGET" == 'forward-char' ]]; then + zle autosuggest-end-of-line-orig "$@" + else + zle autosuggest-${WIDGET}-orig "$@" + fi if [[ -n $ZLE_AUTOSUGGESTING ]]; then autosuggest-invalidate-highlight-cache autosuggest-highlight-suggested-text From 824b9be13fe470fea7d2d82a10081557407fa09b Mon Sep 17 00:00:00 2001 From: Mihai Sucan Date: Tue, 25 Feb 2014 22:45:29 +0200 Subject: [PATCH 2/2] add autosuggestions.plugin.zsh to get this repo working with antigen --- autosuggestions.plugin.zsh | 1 + 1 file changed, 1 insertion(+) create mode 120000 autosuggestions.plugin.zsh diff --git a/autosuggestions.plugin.zsh b/autosuggestions.plugin.zsh new file mode 120000 index 0000000..65220e1 --- /dev/null +++ b/autosuggestions.plugin.zsh @@ -0,0 +1 @@ +autosuggestions.zsh \ No newline at end of file