summaryrefslogtreecommitdiff
path: root/home-config/fish/conf.d/fzf.fish
diff options
context:
space:
mode:
authorRyan Schanzenbacher <ryan@rschanz.org>2024-04-05 11:57:45 -0400
committerRyan Schanzenbacher <ryan@rschanz.org>2024-04-05 11:57:45 -0400
commitb88d77fb2d0d5028a6f5670695dee6bec129501f (patch)
tree2536b0461d297e647cf07157641c9b1223339adf /home-config/fish/conf.d/fzf.fish
parent776a7ca55d2d2c3f396de91db1c6c3c5065012cd (diff)
ahhh sloppy fish, still needs fixing, esp with the vars
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