mirror of
https://github.com/atuinsh/atuin.git
synced 2024-12-26 17:09:14 +01:00
feat(shell)!: bind the Atuin search to "/" in vi-normal mode (#1629)
A search feature in the vi-normal mode of shells can be called by "/". To make the shell-integration keybindings consistent with the existing shell keybindings, we add the keybinding to "/" in this patch. This patch removes the Ctrl-r binding in the "vicmd" keymap in Zsh. The key Ctrl-r is used for the `redo` operation in the vi-normal mode by default. We would like to avoid overwriting an existing keybinding with a totally different feature.
This commit is contained in:
parent
230bf2d1c6
commit
2e48e21692
@ -33,8 +33,8 @@ impl Cmd {
|
|||||||
|
|
||||||
if std::env::var("ATUIN_NOBIND").is_err() {
|
if std::env::var("ATUIN_NOBIND").is_err() {
|
||||||
const BIND_CTRL_R: &str = r"bindkey -M emacs '^r' _atuin_search_widget
|
const BIND_CTRL_R: &str = r"bindkey -M emacs '^r' _atuin_search_widget
|
||||||
bindkey -M vicmd '^r' _atuin_search_vicmd_widget
|
bindkey -M viins '^r' _atuin_search_viins_widget
|
||||||
bindkey -M viins '^r' _atuin_search_viins_widget";
|
bindkey -M vicmd '/' _atuin_search_widget";
|
||||||
|
|
||||||
const BIND_UP_ARROW: &str = r"bindkey -M emacs '^[[A' _atuin_up_search_widget
|
const BIND_UP_ARROW: &str = r"bindkey -M emacs '^[[A' _atuin_up_search_widget
|
||||||
bindkey -M vicmd '^[[A' _atuin_up_search_vicmd_widget
|
bindkey -M vicmd '^[[A' _atuin_up_search_vicmd_widget
|
||||||
|
@ -244,6 +244,7 @@ if [[ $__atuin_bind_ctrl_r == true ]]; then
|
|||||||
# the vi_nmap keymap in ble.sh.
|
# the vi_nmap keymap in ble.sh.
|
||||||
bind -m emacs -x '"\C-r": __atuin_history --keymap-mode=emacs'
|
bind -m emacs -x '"\C-r": __atuin_history --keymap-mode=emacs'
|
||||||
bind -m vi-insert -x '"\C-r": __atuin_history --keymap-mode=vim-insert'
|
bind -m vi-insert -x '"\C-r": __atuin_history --keymap-mode=vim-insert'
|
||||||
|
bind -m vi-command -x '"/": __atuin_history --keymap-mode=emacs'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# shellcheck disable=SC2154
|
# shellcheck disable=SC2154
|
||||||
|
Loading…
Reference in New Issue
Block a user