diff options
author | Roger Gonzalez <roger@rogs.me> | 2023-03-18 16:40:57 -0300 |
---|---|---|
committer | Roger Gonzalez <roger@rogs.me> | 2023-03-18 16:40:57 -0300 |
commit | 8600374371f91843064441113f4023cda1730877 (patch) | |
tree | bb4677ec186dd5c323f1f010207076b7df285606 /.config/fish/functions/_tide_remove_unusable_items.fish | |
parent | c95dd49df12f4f8dc13cf3bdc4dad70a060bd5eb (diff) |
General fish fixes and updates
Diffstat (limited to '.config/fish/functions/_tide_remove_unusable_items.fish')
-rw-r--r-- | .config/fish/functions/_tide_remove_unusable_items.fish | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/.config/fish/functions/_tide_remove_unusable_items.fish b/.config/fish/functions/_tide_remove_unusable_items.fish new file mode 100644 index 00000000..69065dc8 --- /dev/null +++ b/.config/fish/functions/_tide_remove_unusable_items.fish @@ -0,0 +1,21 @@ +function _tide_remove_unusable_items + # Remove tool-specific items for tools the machine doesn't have installed + set -l removed_items + for item in aws chruby docker git go java kubectl nix_shell node php rustc terraform toolbox virtual_env + set -l cli_names $item + switch $item + case virtual_env + set cli_names python python3 + case nix_shell + set cli_names nix nix-shell + end + type --query $cli_names || set -a removed_items $item + end + + set -U _tide_left_items (for item in $tide_left_prompt_items + contains $item $removed_items || echo $item + end) + set -U _tide_right_items (for item in $tide_right_prompt_items + contains $item $removed_items || echo $item + end) +end |