fix(keybinds): guard bindings on required binaries and fix fzf bg-transform
- conf.d/fzf.fish: skip fzf_configure_bindings if fzf is not in PATH - key_bindings.fish: only bind Ctrl+Alt+= when qalc is installed - _qalc_eval: return 1 early if qalc is absent so callers can react - _smart_execute: fall back to normal execute when _qalc_eval returns 1 - integrations/fzf.fish: replace bg-transform with transform (available since fzf 0.53; bg-transform requires a newer version and caused "unknown action" errors on fzf 0.60 devel)
This commit is contained in:
+2
-1
@@ -9,7 +9,8 @@ end
|
||||
# This variable is global so that it can be referenced by fzf_configure_bindings and in tests
|
||||
set --global _fzf_search_vars_command '_fzf_search_variables (set --show | psub) (set --names | psub)'
|
||||
|
||||
# Install the default bindings, which are mnemonic and minimally conflict with fish's preset bindings
|
||||
# Install the default bindings only if fzf is available
|
||||
type -q fzf || exit
|
||||
fzf_configure_bindings
|
||||
|
||||
# Doesn't erase autoloaded _fzf_* functions because they are not easily accessible once key bindings are erased
|
||||
|
||||
@@ -52,7 +52,7 @@ function fish_user_key_bindings
|
||||
bind ctrl-g __insert_previous_path_head
|
||||
bind ctrl-f __interactive_history_sub
|
||||
bind ctrl-alt-u _replace_command_token
|
||||
bind ctrl-alt-= _qalc_eval
|
||||
type -q qalc && bind ctrl-alt-= _qalc_eval
|
||||
bind ctrl-enter _smart_execute
|
||||
|
||||
# Set bindings for all Vi modes:
|
||||
@@ -61,7 +61,7 @@ function fish_user_key_bindings
|
||||
bind --mode $mode ctrl-g __insert_previous_path_head
|
||||
bind --mode $mode ctrl-f __interactive_history_sub
|
||||
bind --mode $mode ctrl-alt-u _replace_command_token
|
||||
bind --mode $mode ctrl-alt-= _qalc_eval
|
||||
type -q qalc && bind --mode $mode ctrl-alt-= _qalc_eval
|
||||
bind --mode $mode ctrl-enter _smart_execute
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user