diff options
| author | Ryan Schanzenbacher <ryan@rschanz.org> | 2024-04-05 11:57:45 -0400 |
|---|---|---|
| committer | Ryan Schanzenbacher <ryan@rschanz.org> | 2024-04-05 11:57:45 -0400 |
| commit | b88d77fb2d0d5028a6f5670695dee6bec129501f (patch) | |
| tree | 2536b0461d297e647cf07157641c9b1223339adf /home-config/fish/conf.d | |
| parent | 776a7ca55d2d2c3f396de91db1c6c3c5065012cd (diff) | |
ahhh sloppy fish, still needs fixing, esp with the vars
Diffstat (limited to 'home-config/fish/conf.d')
| -rw-r--r-- | home-config/fish/conf.d/_tide_init.fish | 44 | ||||
| -rw-r--r-- | home-config/fish/conf.d/fzf.fish | 28 |
2 files changed, 72 insertions, 0 deletions
diff --git a/home-config/fish/conf.d/_tide_init.fish b/home-config/fish/conf.d/_tide_init.fish new file mode 100644 index 0000000..b448002 --- /dev/null +++ b/home-config/fish/conf.d/_tide_init.fish | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | function _tide_init_install --on-event _tide_init_install | ||
| 2 | set -U VIRTUAL_ENV_DISABLE_PROMPT true | ||
| 3 | |||
| 4 | source (functions --details _tide_sub_configure) | ||
| 5 | _load_config lean | ||
| 6 | _tide_finish | ||
| 7 | |||
| 8 | if status is-interactive | ||
| 9 | tide bug-report --check || sleep 4 | ||
| 10 | |||
| 11 | if contains ilancosman/tide (string lower $_fisher_plugins) | ||
| 12 | set_color bryellow | ||
| 13 | echo "ilancosman/tide is a development branch. Please install from a release tag:" | ||
| 14 | _tide_fish_colorize "fisher install ilancosman/tide@v6" | ||
| 15 | sleep 3 | ||
| 16 | end | ||
| 17 | |||
| 18 | switch (read --prompt-str="Configure tide prompt? [Y/n] " | string lower) | ||
| 19 | case y ye yes '' | ||
| 20 | tide configure | ||
| 21 | case '*' | ||
| 22 | echo -s \n 'Run ' (_tide_fish_colorize "tide configure") ' to customize your prompt.' | ||
| 23 | end | ||
| 24 | end | ||
| 25 | end | ||
| 26 | |||
| 27 | function _tide_init_update --on-event _tide_init_update | ||
| 28 | # Warn users who install from main branch | ||
| 29 | if contains ilancosman/tide (string lower $_fisher_plugins) | ||
| 30 | set_color bryellow | ||
| 31 | echo "ilancosman/tide is a development branch. Please install from a release tag:" | ||
| 32 | _tide_fish_colorize "fisher install ilancosman/tide@v6" | ||
| 33 | sleep 3 | ||
| 34 | end | ||
| 35 | |||
| 36 | # Set (disable) the new jobs variable | ||
| 37 | set -q tide_jobs_number_threshold || set -U tide_jobs_number_threshold 1000 | ||
| 38 | end | ||
| 39 | |||
| 40 | function _tide_init_uninstall --on-event _tide_init_uninstall | ||
| 41 | set -e VIRTUAL_ENV_DISABLE_PROMPT | ||
| 42 | set -e (set -U --names | string match --entire -r '^_?tide') | ||
| 43 | functions --erase (functions --all | string match --entire -r '^_?tide') | ||
| 44 | end | ||
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 | ||
| 2 | if not status is-interactive && test "$CI" != true | ||
| 3 | exit | ||
| 4 | end | ||
| 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 | ||
| 10 | set --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 | ||
| 14 | fzf_configure_bindings | ||
| 15 | |||
| 16 | # Doesn't erase autoloaded _fzf_* functions because they are not easily accessible once key bindings are erased | ||
| 17 | function _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 | ||
| 28 | end | ||
