summaryrefslogtreecommitdiffstats
path: root/shell/key-bindings.bash
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2018-02-16 21:55:23 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2018-02-16 21:55:23 +0900
commit3f868fd792eb70edf3530352d50a25ce833c033d (patch)
tree79a41a1d83b49c33ddbe0361856e477fc48c95f3 /shell/key-bindings.bash
parent417bca03dfa9a15a37d64678b5a4a175db6eb0a1 (diff)
[bash] Fix CTRL-R to preserve the latest yank
Close #1216 1. Append a single space so that step 3 won't fail 2. CTRL-E to move to the end of the line 3. CTRL-U to delete the whole line before the cursor 4. CTRL-Y to paste the deleted line 5. ESC+Y to rotate the kill ring and bring back the previous yank before step 3 6. CTRL-U to delete the whole line again 7. Paste `__fzf_history__` 8. ESC+CTRL-E to expand the command substitution 9. ESC+R to redraw the line 10. ESC+^ to expand the history entry (!NUMBER)
Diffstat (limited to 'shell/key-bindings.bash')
-rw-r--r--shell/key-bindings.bash2
1 files changed, 1 insertions, 1 deletions
diff --git a/shell/key-bindings.bash b/shell/key-bindings.bash
index 91ef1ec1..29c5c962 100644
--- a/shell/key-bindings.bash
+++ b/shell/key-bindings.bash
@@ -80,7 +80,7 @@ if [[ ! -o vi ]]; then
fi
# CTRL-R - Paste the selected command from history into the command line
- bind '"\C-r": " \C-e\C-u`__fzf_history__`\e\C-e\er\e^"'
+ bind '"\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 '"\ec": " \C-e\C-u`__fzf_cd__`\e\C-e\er\C-m"'