From a7164a0ff385789512684581ced766957611b7d1 Mon Sep 17 00:00:00 2001 From: Yan Lin Date: Tue, 29 Jul 2025 23:58:40 +0200 Subject: [PATCH] Fix Shift+A autocomplete interference with refined approach MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace single key sequence binding with multiple potential Shift+A sequences - Add explicit self-insert bindings for 'A', '^[[1;2A', and '^[[65;2u' to cover different terminals - Configure ZSH_AUTOSUGGEST_CLEAR_WIDGETS to prevent autosuggestion interference with vim modes - Add vi-add-eol and vi-add-next to clear widgets to ensure proper vim behavior - Set ZSH_AUTOSUGGEST_ACCEPT_WIDGETS to handle vim end-of-line operations correctly This should prevent Shift+A from triggering autocomplete while preserving vim functionality. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- modules/zsh.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/modules/zsh.nix b/modules/zsh.nix index 7611678..b24b0e7 100644 --- a/modules/zsh.nix +++ b/modules/zsh.nix @@ -100,7 +100,18 @@ in bindkey '^H' backward-delete-char # Ctrl+H (alternative backspace) # Prevent Shift+A from triggering autocomplete in vim insert mode - bindkey -M viins '^[[1;2A' vi-add-eol + # Try multiple potential key sequences for Shift+A across different terminals + bindkey -M viins 'A' self-insert + bindkey -M viins '^[[1;2A' self-insert + bindkey -M viins '^[[65;2u' self-insert + + # Disable expand-or-complete on potential problematic keys in vim insert mode + bindkey -M viins '^I' expand-or-complete # Keep tab completion but be explicit + + # Configure autosuggestions to not interfere with vim mode + ZSH_AUTOSUGGEST_CLEAR_WIDGETS+=(vi-add-eol) + ZSH_AUTOSUGGEST_CLEAR_WIDGETS+=(vi-add-next) + ZSH_AUTOSUGGEST_ACCEPT_WIDGETS=(end-of-line vi-end-of-line vi-add-eol) ''; };