Skip to content
Myr

Fix #22. Keybindings for vi-mode bash.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Junegunn Choi · committed by Junegunn Choi · parent 245ee42 · Browse files · 1 file+20 added−7 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+20 added−7 removed

  • other:+20 added−7 removed

1 file+20 added−7 removed

modified:install+20 added-7 removed
95 unmodified lines
96# Key bindings97# ------------98if [[ $- =~ i ]]; then99100# Required to refresh the prompt after fzf101bind '"\er": redraw-current-line'102103# CTRL-T - Paste the selected file path into the command line100__fsel() {101 find * -path '*/\.*' -prune \102 -o -type f -print \103 -o -type d -print \
1 unmodified line
105 printf '%q ' "$item"106 done107 echo108}113bind '"\C-t": " \C-u \C-a\C-k$(__fsel)\e\C-e\C-y\C-a\C-y\ey\C-h\C-e\er"'109115# CTRL-R - Paste the selected command from history into the command line116bind '"\C-r": " \C-e\C-u$(HISTTIMEFORMAT= history | fzf +s | sed \"s/ *[0-9]* *//\")\e\C-e\er"'110if [ -z "$(set -o | grep '^vi.*on')" ]; then111 # Required to refresh the prompt after fzf112 bind '"\er": redraw-current-line'113114 # CTRL-T - Paste the selected file path into the command line115 bind '"\C-t": " \C-u \C-a\C-k$(__fsel)\e\C-e\C-y\C-a\C-y\ey\C-h\C-e\er"'116117 # CTRL-R - Paste the selected command from history into the command line118 bind '"\C-r": " \C-e\C-u$(HISTTIMEFORMAT= history | fzf +s | sed \"s/ *[0-9]* *//\")\e\C-e\er"'119else120 bind '"\C-x\C-e": shell-expand-line'121 bind '"\C-x\C-r": redraw-current-line'122123 # CTRL-T - Paste the selected file path into the command line124 # - FIXME: Selected items are attached to the end regardless of cursor position125 bind '"\C-t": "\eddi$(__fsel)\C-x\C-e\e0P$a \C-x\C-r"'126127 # CTRL-R - Paste the selected command from history into the command line128 bind '"\C-r": "\eddi$(HISTTIMEFORMAT= history | fzf +s | sed \"s/ *[0-9]* *//\")\C-x\C-e\e$a\C-x\C-r"'129fi130131fi132EOF133 else134 cat >> $src << "EOF"135# Key bindings
67 unmodified lines