summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2025-01-18 02:33:28 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2025-01-18 02:33:28 +0900
commit0a10d14e190eac2d3aa3d88f3b45e84d3f4431be (patch)
treeb75b211e13ea09dc06ec42818dedc459d690a693
parented8ceec66f2a3fd380acfb1e181b260cd21b8c5f (diff)
downloadfzf-0a10d14e190eac2d3aa3d88f3b45e84d3f4431be.tar.gz
[fish] CTRL-R: Make loading non-blocking
-rw-r--r--shell/key-bindings.fish6
1 files changed, 4 insertions, 2 deletions
diff --git a/shell/key-bindings.fish b/shell/key-bindings.fish
index 31552357..3d5c36e9 100644
--- a/shell/key-bindings.fish
+++ b/shell/key-bindings.fish
@@ -70,13 +70,15 @@ function fzf_key_bindings
set -lx FZF_DEFAULT_OPTS (__fzf_defaults "" "-n2..,.. --scheme=history --bind=ctrl-r:toggle-sort --wrap-sign '"\t"↳ ' --highlight-line $FZF_CTRL_R_OPTS +m")
set -lx FZF_DEFAULT_OPTS_FILE ''
if type -q perl
- builtin history -z --reverse | command perl -0 -pe 's/^/$.\t/g; s/\n/\n\t/gm' | eval (__fzfcmd) --tac --read0 --print0 -q '(commandline)' | string replace -r '^\d*\t' '' | read -lz result
+ set -l fzf_command (__fzfcmd) --tac --read0 --print0 -q (commandline)
+ builtin history -z --reverse | command perl -0 -pe 's/^/$.\t/g; s/\n/\n\t/gm' | $fzf_command | string replace -r '^\d*\t' '' | read -lz result
and commandline -- $result
else
set -l h (builtin history -z | string split0)
+ set -l fzf_command (__fzfcmd) --read0 --print0 -q (commandline)
for i in (seq (count $h) -1 1)
string join0 -- $i\t(string replace -a -- \n \n\t $h[$i] | string collect)
- end | eval (__fzfcmd) --read0 --print0 -q '(commandline)' | string replace -r '^\d*\t' '' | read -lz result
+ end | $fzf_command | string replace -r '^\d*\t' '' | read -lz result
and commandline -- $result
end
else