From a1799af567d16083783a250392a845276beee18e Mon Sep 17 00:00:00 2001 From: Patrick Jackson Date: Mon, 30 Oct 2023 02:24:24 -0600 Subject: [PATCH] fix(zsh): bind in the most popular modes (#1360) --- atuin/src/command/init.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/atuin/src/command/init.rs b/atuin/src/command/init.rs index b2fb7f1..87b876c 100644 --- a/atuin/src/command/init.rs +++ b/atuin/src/command/init.rs @@ -32,9 +32,16 @@ impl Cmd { println!("{base}"); if std::env::var("ATUIN_NOBIND").is_err() { - const BIND_CTRL_R: &str = "bindkey '^r' _atuin_search_widget"; - const BIND_UP_ARROW: &str = "bindkey '^[[A' _atuin_up_search_widget -bindkey '^[OA' _atuin_up_search_widget"; + const BIND_CTRL_R: &str = r#"bindkey -M emacs '^r' _atuin_search_widget +bindkey -M vicmd '^r' _atuin_search_widget +bindkey -M viins '^r' _atuin_search_widget"#; + const BIND_UP_ARROW: &str = r#"bindkey -M emacs '^[[A' _atuin_up_search_widget +bindkey -M vicmd '^[[A' _atuin_up_search_widget +bindkey -M viins '^[[A' _atuin_up_search_widget +bindkey -M emacs '^[OA' _atuin_up_search_widget +bindkey -M vicmd '^[OA' _atuin_up_search_widget +bindkey -M viins '^[OA' _atuin_up_search_widget +bindkey -M vicmd 'k' _atuin_up_search_widget"#; if !self.disable_ctrl_r { println!("{BIND_CTRL_R}"); }