From fc6375b6dead29ef9449ea6ee40c59c3c74bd499 Mon Sep 17 00:00:00 2001 From: Christian Sidak Date: Wed, 2 Sep 2026 17:50:58 -0700 Subject: [PATCH] Bind Ctrl+F in vi keymaps for zsh The zsh integration only ran a bare bindkey, which installs the widget in whichever keymap is active when the file is sourced. Users who enable vi mode (bindkey -v) after sourcing ended up with Ctrl+F doing nothing, and even when vi mode was enabled first the binding was missing from vicmd. Bind explicitly in the emacs, viins, and vicmd keymaps, matching what the bash integration already does with bind -m for emacs-standard, vi-insert, and vi-command. Fixes #51 --- src/shelloracle/shell/shelloracle.zsh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/shelloracle/shell/shelloracle.zsh b/src/shelloracle/shell/shelloracle.zsh index edf4d71..81e0d8f 100644 --- a/src/shelloracle/shell/shelloracle.zsh +++ b/src/shelloracle/shell/shelloracle.zsh @@ -25,5 +25,9 @@ shelloracle-widget() { # Register the function as a ZLE widget zle -N shelloracle-widget -# Install the ZLE widget as a keyboard shortcut Ctrl+F -bindkey '^F' shelloracle-widget \ No newline at end of file +# Install the ZLE widget as a keyboard shortcut Ctrl+F in every keymap, so it +# works in both emacs mode and vi mode (insert and command), regardless of +# whether `bindkey -v` runs before or after this file is sourced. +bindkey -M emacs '^F' shelloracle-widget +bindkey -M viins '^F' shelloracle-widget +bindkey -M vicmd '^F' shelloracle-widget \ No newline at end of file