From f9d7877d8b01e58c53c5b7f746f02c8ab81b17d6 Mon Sep 17 00:00:00 2001 From: xty Date: Tue, 19 Aug 2025 22:31:02 +0800 Subject: [PATCH] [bash 3] Fix CTRL-T and ALT-C to preserve the last yank (#4496) --- shell/key-bindings.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shell/key-bindings.bash b/shell/key-bindings.bash index 50edecef..b83d26a0 100644 --- a/shell/key-bindings.bash +++ b/shell/key-bindings.bash @@ -125,7 +125,7 @@ bind -m emacs-standard '"\C-z": vi-editing-mode' if (( BASH_VERSINFO[0] < 4 )); then # CTRL-T - Paste the selected file path into the command line if [[ "${FZF_CTRL_T_COMMAND-x}" != "" ]]; then - bind -m emacs-standard '"\C-t": " \C-b\C-k \C-u`__fzf_select__`\e\C-e\er\C-a\C-y\C-h\C-e\e \C-y\ey\C-x\C-x\C-f"' + bind -m emacs-standard '"\C-t": " \C-b\C-k \C-u`__fzf_select__`\e\C-e\er\C-a\C-y\C-h\C-e\e \C-y\ey\C-x\C-x\C-f\C-y\ey\C-_"' bind -m vi-command '"\C-t": "\C-z\C-t\C-z"' bind -m vi-insert '"\C-t": "\C-z\C-t\C-z"' fi @@ -150,7 +150,7 @@ fi # ALT-C - cd into the selected directory if [[ "${FZF_ALT_C_COMMAND-x}" != "" ]]; then - bind -m emacs-standard '"\ec": " \C-b\C-k \C-u`__fzf_cd__`\e\C-e\er\C-m\C-y\C-h\e \C-y\ey\C-x\C-x\C-d"' + bind -m emacs-standard '"\ec": " \C-b\C-k \C-u`__fzf_cd__`\e\C-e\er\C-m\C-y\C-h\e \C-y\ey\C-x\C-x\C-d\C-y\ey\C-_"' bind -m vi-command '"\ec": "\C-z\ec\C-z"' bind -m vi-insert '"\ec": "\C-z\ec\C-z"' fi