From 5d4a7758c06f13da15341bf8b0a05144f97fdab0 Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Wed, 27 Oct 2021 08:18:24 +0100 Subject: [PATCH] Tweaked zsh autocomplete Signed-off-by: Marcus Noble --- .dotfiles/1-zsh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.dotfiles/1-zsh b/.dotfiles/1-zsh index e56a025..20f67f3 100644 --- a/.dotfiles/1-zsh +++ b/.dotfiles/1-zsh @@ -1,13 +1,28 @@ export ZSH="$HOME/.oh-my-zsh" +export ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=20 + plugins=( - asdf aws zsh-syntax-highlighting zsh-autosuggestions ) autoload -U compinit && compinit +# This speeds up pasting w/ autosuggest +# https://github.com/zsh-users/zsh-autosuggestions/issues/238 +pasteinit() { + OLD_SELF_INSERT=${${(s.:.)widgets[self-insert]}[2,3]} + zle -N self-insert url-quote-magic # I wonder if you'd need `.url-quote-magic`? +} +pastefinish() { + zle -N self-insert $OLD_SELF_INSERT +} +zstyle :bracketed-paste-magic paste-init pasteinit +zstyle :bracketed-paste-magic paste-finish pastefinish +# https://github.com/zsh-users/zsh-autosuggestions/issues/351 +ZSH_AUTOSUGGEST_CLEAR_WIDGETS+=(bracketed-paste accept-line) + DISABLE_UNTRACKED_FILES_DIRTY="true" SHOW_AWS_PROMPT=false