summaryrefslogtreecommitdiff
path: root/home-config/fish/conf.d/fzf.fish
diff options
context:
space:
mode:
Diffstat (limited to 'home-config/fish/conf.d/fzf.fish')
-rw-r--r--home-config/fish/conf.d/fzf.fish28
1 files changed, 28 insertions, 0 deletions
diff --git a/home-config/fish/conf.d/fzf.fish b/home-config/fish/conf.d/fzf.fish
new file mode 100644
index 0000000..8156c11
--- /dev/null
+++ b/home-config/fish/conf.d/fzf.fish
@@ -0,0 +1,28 @@
1# fzf.fish is only meant to be used in interactive mode. If not in interactive mode and not in CI, skip the config to speed up shell startup
2if not status is-interactive && test "$CI" != true
3 exit
4end
5
6# Because of scoping rules, to capture the shell variables exactly as they are, we must read
7# them before even executing _fzf_search_variables. We use psub to store the
8# variables' info in temporary files and pass in the filenames as arguments.
9# This variable is global so that it can be referenced by fzf_configure_bindings and in tests
10set --global _fzf_search_vars_command '_fzf_search_variables (set --show | psub) (set --names | psub)'
11
12
13# Install the default bindings, which are mnemonic and minimally conflict with fish's preset bindings
14fzf_configure_bindings
15
16# Doesn't erase autoloaded _fzf_* functions because they are not easily accessible once key bindings are erased
17function _fzf_uninstall --on-event fzf_uninstall
18 _fzf_uninstall_bindings
19
20 set --erase _fzf_search_vars_command
21 functions --erase _fzf_uninstall _fzf_migration_message _fzf_uninstall_bindings fzf_configure_bindings
22 complete --erase fzf_configure_bindings
23
24 set_color cyan
25 echo "fzf.fish uninstalled."
26 echo "You may need to manually remove fzf_configure_bindings from your config.fish if you were using custom key bindings."
27 set_color normal
28end