mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-20 09:33:42 -05:00
edit: Another CTRL-R script to insert the selected command from history into the command line/region
16
Examples.md
16
Examples.md
@@ -125,13 +125,21 @@ __fzf_history ()
|
|||||||
: end
|
: end
|
||||||
'
|
'
|
||||||
)";
|
)";
|
||||||
READLINE_LINE="${READLINE_LINE:+${READLINE_LINE:0:READLINE_POINT}}${READLINE_LINE_NEW}${READLINE_LINE:+${READLINE_LINE:READLINE_POINT}}";
|
|
||||||
READLINE_POINT="$((READLINE_POINT + ${#READLINE_LINE_NEW}))"
|
if
|
||||||
|
[[ -n $READLINE_LINE_NEW ]]
|
||||||
|
then
|
||||||
|
builtin bind '"\er": redraw-current-line'
|
||||||
|
builtin bind '"\e^": magic-space'
|
||||||
|
READLINE_LINE=${READLINE_LINE:+${READLINE_LINE:0:READLINE_POINT}}${READLINE_LINE_NEW}${READLINE_LINE:+${READLINE_LINE:READLINE_POINT}}
|
||||||
|
READLINE_POINT=$(( READLINE_POINT + ${#READLINE_LINE_NEW} ))
|
||||||
|
else
|
||||||
|
builtin bind '"\er":'
|
||||||
|
builtin bind '"\e^":'
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
builtin set -o histexpand;
|
builtin set -o histexpand;
|
||||||
builtin bind '"\er": redraw-current-line';
|
|
||||||
builtin bind '"\e^": magic-space';
|
|
||||||
builtin bind -x '"\C-x1": __fzf_history';
|
builtin bind -x '"\C-x1": __fzf_history';
|
||||||
builtin bind '"\C-r": "\C-x1\e^\er"'
|
builtin bind '"\C-r": "\C-x1\e^\er"'
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user