summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Bates <jack@nottheoilrig.com>2020-02-23 07:24:50 -0700
committerGitHub <noreply@github.com>2020-02-23 23:24:50 +0900
commit1ccd8f6a647a31f8cb1d683d25d9f21ab28b11cc (patch)
tree6c7f3f7e054fd8ae6f3f12c5e110ecf3e0a95ffe
parent9c293bb82b6be333c857d288d10aab730220a0e7 (diff)
[bash] Restore insertion point pre Bash 4 (#1881)
Make C-t more consistent pre and post Bash 4. It already kills the command line separately before and after the insertion point. Add set-mark and exchange-point-and-mark to restore the insertion point after yanking back and apply the same behavior to M-c. * CTRL-T should put extra space after pasted items Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
-rw-r--r--shell/key-bindings.bash8
1 files changed, 4 insertions, 4 deletions
diff --git a/shell/key-bindings.bash b/shell/key-bindings.bash
index 5ac327e2..d41f0be1 100644
--- a/shell/key-bindings.bash
+++ b/shell/key-bindings.bash
@@ -73,16 +73,16 @@ bind -m emacs-standard '"\e^": history-expand-line'
if [ $BASH_VERSINFO -gt 3 ]; then
bind -m emacs-standard -x '"\C-t": "fzf-file-widget"'
elif __fzf_use_tmux__; then
- bind -m emacs-standard '"\C-t": " \C-u \C-a\C-k`__fzf_select_tmux__`\e\C-e\C-y\C-a\C-d\C-y\ey\C-h"'
+ bind -m emacs-standard '"\C-t": " \C-b\C-k \C-u`__fzf_select_tmux__`\e\C-e\C-a\C-y\C-h\C-e\e \C-y\ey\C-x\C-x\C-f"'
else
- bind -m emacs-standard '"\C-t": " \C-u \C-a\C-k`__fzf_select__`\e\C-e\C-y\C-a\C-y\ey\C-h\C-e\er \C-h"'
+ 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"'
fi
# CTRL-R - Paste the selected command from history into the command line
-bind -m emacs-standard '"\C-r": " \C-e\C-u\C-y\ey\C-u`__fzf_history__`\e\C-e\er\e^"'
+bind -m emacs-standard '"\C-r": "\C-e \C-u\C-y\ey\C-u`__fzf_history__`\e\C-e\er\e^"'
# ALT-C - cd into the selected directory
-bind -m emacs-standard '"\ec": " \C-e\C-u`__fzf_cd__`\e\C-e\er\C-m"'
+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 vi-command '"\C-z": emacs-editing-mode'
bind -m vi-insert '"\C-z": emacs-editing-mode'