Skip to content
Myr

[fish] Add version check

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

authored by bitraid · committed by Junegunn Choi · parent ad33165 · Browse files · 1 file+13 added−4 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+13 added−4 removed

  • other:+13 added−4 removed

1 file+13 added−4 removed

modified:shell/key-bindings.fish+13 added-4 removed
12 unmodified lines
131415# Key bindings16# ------------17# For compatibility with fish versions down to 3.1.2, the script does not use:18# - The -f/--function switch of command: set19# - The process substitution syntax: $(cmd)20# - Ranges that omit start/end indexes: $var[$start..] $var[..$end] $var[..]17# The oldest supported fish version is 3.1b1. To maintain compatibility, the18# command substitution syntax $(cmd) should never be used, even behind a version19# check, otherwise the source command will fail on fish versions older than 3.4.0.20function fzf_key_bindings2122 # Check fish version23 set -l fish_ver (string match -r '^(\d+).(\d+)' $version 2> /dev/null; or echo 0\n0\n0)24 if test \( "$fish_ver[2]" -lt 3 \) -o \( "$fish_ver[2]" -eq 3 -a "$fish_ver[3]" -lt 1 \)25 echo "This script requires fish version 3.1b1 or newer." >&226 return 127 else if not type -q fzf28 echo "fzf was not found in path." >&229 return 130 end3132 function __fzf_defaults33 # $argv[1]: Prepend to FZF_DEFAULT_OPTS_FILE and FZF_DEFAULT_OPTS34 # $argv[2..]: Append to FZF_DEFAULT_OPTS_FILE and FZF_DEFAULT_OPTS35 test -n "$FZF_TMUX_HEIGHT"; or set -l FZF_TMUX_HEIGHT 40%
199 unmodified lines