From 01676919414a1b78e6255b2f217d42dab1076d50 Mon Sep 17 00:00:00 2001 From: bitraid Date: Thu, 19 Dec 2024 11:36:37 +0200 Subject: [PATCH] [fish] Small syntax modification of some commands No actual change, just for consistency with the rest of the code. --- shell/key-bindings.fish | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/shell/key-bindings.fish b/shell/key-bindings.fish index 9a0dcc3..b1c3689 100644 --- a/shell/key-bindings.fish +++ b/shell/key-bindings.fish @@ -57,8 +57,8 @@ function fzf_key_bindings function fzf-history-widget -d "Show command history" test -n "$FZF_TMUX_HEIGHT"; or set FZF_TMUX_HEIGHT 40% begin - set -l FISH_MAJOR (string split '.' -- $version)[1] - set -l FISH_MINOR (string split '.' -- $version)[2] + set -l FISH_MAJOR (string split -f 1 -- '.' $version) + set -l FISH_MINOR (string split -f 2 -- '.' $version) # merge history from other sessions before searching test -z "$fish_private_mode"; and builtin history merge @@ -157,13 +157,13 @@ function fzf_key_bindings # so that after eval, the original string is returned, but with the # variable names replaced by their values. set commandline (string escape -n -- $commandline) - set commandline (string replace -r -a '\x5c\$(?=[\w])' '\$' -- $commandline) + set commandline (string replace -r -a -- '\x5c\$(?=[\w])' '\$' $commandline) # eval is used to do shell expansion on paths eval set commandline $commandline # Combine multiple consecutive slashes into one - set commandline (string replace -r -a '/+' '/' -- $commandline) + set commandline (string replace -r -a -- '/+' '/' $commandline) if test -z "$commandline" # Default to current directory with no --query @@ -180,7 +180,7 @@ function fzf_key_bindings set fzf_query $commandline else # Also remove trailing slash after dir, to "split" input properly - set fzf_query (string replace -r "^$dir/?" '' -- $commandline) + set fzf_query (string replace -r -- "^$dir/?" '' $commandline) end end @@ -193,7 +193,7 @@ function fzf_key_bindings set dir $argv # Strip trailing slash, unless $dir is root dir (/) - set dir (string replace -r '(?