From a0269584a488d9ac11f287e5e2eca7d34a4a66e0 Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Wed, 1 Dec 2021 23:16:13 -0500 Subject: [PATCH] [fish] Add tide configuration --- fish/.config/fish/fish_variables | 89 ++++---- .../fish/functions/_tide_cache_variables.fish | 18 ++ .../fish/functions/_tide_detect_os.fish | 47 ++++ .../fish/functions/_tide_find_and_remove.fish | 3 + .../fish/functions/_tide_item_character.fish | 22 ++ .../fish/functions/_tide_item_chruby.fish | 3 + .../functions/_tide_item_cmd_duration.fish | 15 ++ .../fish/functions/_tide_item_context.fish | 9 + .../fish/functions/_tide_item_git.fish | 71 ++++++ .../.config/fish/functions/_tide_item_go.fish | 3 + .../fish/functions/_tide_item_jobs.fish | 3 + .../fish/functions/_tide_item_kubectl.fish | 4 + .../fish/functions/_tide_item_newline.fish | 5 + .../fish/functions/_tide_item_node.fish | 3 + .../.config/fish/functions/_tide_item_os.fish | 3 + .../fish/functions/_tide_item_php.fish | 3 + .../fish/functions/_tide_item_rustc.fish | 3 + .../fish/functions/_tide_item_shlvl.fish | 4 + .../fish/functions/_tide_item_status.fish | 20 ++ .../fish/functions/_tide_item_terraform.fish | 6 + .../fish/functions/_tide_item_time.fish | 3 + .../fish/functions/_tide_item_vi_mode.fish | 13 ++ .../functions/_tide_item_virtual_env.fish | 12 + .../fish/functions/_tide_print_item.fish | 35 +++ fish/.config/fish/functions/_tide_prompt.fish | 61 +++++ fish/.config/fish/functions/_tide_pwd.fish | 44 ++++ .../_tide_remove_unusable_items.fish | 15 ++ .../fish/functions/_tide_sub_bug-report.fish | 71 ++++++ .../fish/functions/_tide_sub_configure.fish | 92 ++++++++ .../fish/functions/fish_mode_prompt.fish | 1 + fish/.config/fish/functions/fisher.fish | 209 ++++++++++++++++++ fish/.config/fish/functions/tide.fish | 27 +++ .../tide/configure/choices/all/finish.fish | 43 ++++ .../tide/configure/choices/all/icons.fish | 33 +++ .../configure/choices/all/prompt_colors.fish | 26 +++ .../choices/all/prompt_connection.fish | 28 +++ .../prompt_connection_andor_frame_color.fish | 36 +++ .../configure/choices/all/prompt_spacing.fish | 21 ++ .../tide/configure/choices/all/show_time.fish | 31 +++ .../tide/configure/choices/all/style.fish | 33 +++ .../choices/classic/classic_prompt_color.fish | 32 +++ .../classic/classic_prompt_separators.fish | 40 ++++ .../choices/lean/lean_prompt_height.fish | 22 ++ .../powerline/powerline_prompt_frame.fish | 46 ++++ .../powerline/powerline_prompt_heads.fish | 40 ++++ .../powerline/powerline_prompt_height.fish | 30 +++ .../powerline/powerline_prompt_tails.fish | 48 ++++ .../rainbow/rainbow_prompt_separators.fish | 40 ++++ .../tide/configure/configs/classic.fish | 105 +++++++++ .../configure/configs/classic_16color.fish | 59 +++++ .../tide/configure/configs/lean.fish | 105 +++++++++ .../tide/configure/configs/lean_16color.fish | 59 +++++ .../tide/configure/configs/rainbow.fish | 105 +++++++++ .../configure/configs/rainbow_16color.fish | 59 +++++ .../_fake_tide_item_cmd_duration.fish | 3 + .../functions/_fake_tide_item_git.fish | 3 + .../functions/_fake_tide_item_newline.fish | 5 + .../functions/_fake_tide_item_os.fish | 3 + .../_fake_tide_item_prompt_char.fish | 3 + .../functions/_fake_tide_item_pwd.fish | 7 + .../functions/_fake_tide_item_time.fish | 3 + .../functions/_fake_tide_print_item.fish | 38 ++++ .../functions/_fake_tide_prompt.fish | 66 ++++++ 63 files changed, 2044 insertions(+), 45 deletions(-) create mode 100644 fish/.config/fish/functions/_tide_cache_variables.fish create mode 100644 fish/.config/fish/functions/_tide_detect_os.fish create mode 100644 fish/.config/fish/functions/_tide_find_and_remove.fish create mode 100644 fish/.config/fish/functions/_tide_item_character.fish create mode 100644 fish/.config/fish/functions/_tide_item_chruby.fish create mode 100644 fish/.config/fish/functions/_tide_item_cmd_duration.fish create mode 100644 fish/.config/fish/functions/_tide_item_context.fish create mode 100644 fish/.config/fish/functions/_tide_item_git.fish create mode 100644 fish/.config/fish/functions/_tide_item_go.fish create mode 100644 fish/.config/fish/functions/_tide_item_jobs.fish create mode 100644 fish/.config/fish/functions/_tide_item_kubectl.fish create mode 100644 fish/.config/fish/functions/_tide_item_newline.fish create mode 100644 fish/.config/fish/functions/_tide_item_node.fish create mode 100644 fish/.config/fish/functions/_tide_item_os.fish create mode 100644 fish/.config/fish/functions/_tide_item_php.fish create mode 100644 fish/.config/fish/functions/_tide_item_rustc.fish create mode 100644 fish/.config/fish/functions/_tide_item_shlvl.fish create mode 100644 fish/.config/fish/functions/_tide_item_status.fish create mode 100644 fish/.config/fish/functions/_tide_item_terraform.fish create mode 100644 fish/.config/fish/functions/_tide_item_time.fish create mode 100644 fish/.config/fish/functions/_tide_item_vi_mode.fish create mode 100644 fish/.config/fish/functions/_tide_item_virtual_env.fish create mode 100644 fish/.config/fish/functions/_tide_print_item.fish create mode 100644 fish/.config/fish/functions/_tide_prompt.fish create mode 100644 fish/.config/fish/functions/_tide_pwd.fish create mode 100644 fish/.config/fish/functions/_tide_remove_unusable_items.fish create mode 100644 fish/.config/fish/functions/_tide_sub_bug-report.fish create mode 100644 fish/.config/fish/functions/_tide_sub_configure.fish create mode 100644 fish/.config/fish/functions/fish_mode_prompt.fish create mode 100644 fish/.config/fish/functions/fisher.fish create mode 100644 fish/.config/fish/functions/tide.fish create mode 100644 fish/.config/fish/functions/tide/configure/choices/all/finish.fish create mode 100644 fish/.config/fish/functions/tide/configure/choices/all/icons.fish create mode 100644 fish/.config/fish/functions/tide/configure/choices/all/prompt_colors.fish create mode 100644 fish/.config/fish/functions/tide/configure/choices/all/prompt_connection.fish create mode 100644 fish/.config/fish/functions/tide/configure/choices/all/prompt_connection_andor_frame_color.fish create mode 100644 fish/.config/fish/functions/tide/configure/choices/all/prompt_spacing.fish create mode 100644 fish/.config/fish/functions/tide/configure/choices/all/show_time.fish create mode 100644 fish/.config/fish/functions/tide/configure/choices/all/style.fish create mode 100644 fish/.config/fish/functions/tide/configure/choices/classic/classic_prompt_color.fish create mode 100644 fish/.config/fish/functions/tide/configure/choices/classic/classic_prompt_separators.fish create mode 100644 fish/.config/fish/functions/tide/configure/choices/lean/lean_prompt_height.fish create mode 100644 fish/.config/fish/functions/tide/configure/choices/powerline/powerline_prompt_frame.fish create mode 100644 fish/.config/fish/functions/tide/configure/choices/powerline/powerline_prompt_heads.fish create mode 100644 fish/.config/fish/functions/tide/configure/choices/powerline/powerline_prompt_height.fish create mode 100644 fish/.config/fish/functions/tide/configure/choices/powerline/powerline_prompt_tails.fish create mode 100644 fish/.config/fish/functions/tide/configure/choices/rainbow/rainbow_prompt_separators.fish create mode 100644 fish/.config/fish/functions/tide/configure/configs/classic.fish create mode 100644 fish/.config/fish/functions/tide/configure/configs/classic_16color.fish create mode 100644 fish/.config/fish/functions/tide/configure/configs/lean.fish create mode 100644 fish/.config/fish/functions/tide/configure/configs/lean_16color.fish create mode 100644 fish/.config/fish/functions/tide/configure/configs/rainbow.fish create mode 100644 fish/.config/fish/functions/tide/configure/configs/rainbow_16color.fish create mode 100644 fish/.config/fish/functions/tide/configure/functions/_fake_tide_item_cmd_duration.fish create mode 100644 fish/.config/fish/functions/tide/configure/functions/_fake_tide_item_git.fish create mode 100644 fish/.config/fish/functions/tide/configure/functions/_fake_tide_item_newline.fish create mode 100644 fish/.config/fish/functions/tide/configure/functions/_fake_tide_item_os.fish create mode 100644 fish/.config/fish/functions/tide/configure/functions/_fake_tide_item_prompt_char.fish create mode 100644 fish/.config/fish/functions/tide/configure/functions/_fake_tide_item_pwd.fish create mode 100644 fish/.config/fish/functions/tide/configure/functions/_fake_tide_item_time.fish create mode 100644 fish/.config/fish/functions/tide/configure/functions/_fake_tide_print_item.fish create mode 100644 fish/.config/fish/functions/tide/configure/functions/_fake_tide_prompt.fish diff --git a/fish/.config/fish/fish_variables b/fish/.config/fish/fish_variables index ef78d4f..983327f 100644 --- a/fish/.config/fish/fish_variables +++ b/fish/.config/fish/fish_variables @@ -13,9 +13,8 @@ SETUVAR _fisher_jorgebucaran_2F_fisher_files:/home/powellc/\x2econfig/fish/funct SETUVAR _fisher_joseluisq_2F_gitnow_files:/home/powellc/\x2econfig/fish/functions/__gitnow_config_file\x2efish\x1e/home/powellc/\x2econfig/fish/functions/__gitnow_functions\x2efish\x1e/home/powellc/\x2econfig/fish/functions/__gitnow_manual\x2efish\x1e/home/powellc/\x2econfig/fish/conf\x2ed/gitnow\x2efish\x1e/home/powellc/\x2econfig/fish/conf\x2ed/gitnow_config\x2efish\x1e/home/powellc/\x2econfig/fish/completions/__gitnow_completions\x2efish SETUVAR _fisher_oh_2D_my_2D_fish_2F_plugin_2D_direnv_files:/home/powellc/\x2econfig/fish/conf\x2ed/direnv\x2efish SETUVAR _fisher_plugins:jorgebucaran/fisher\x1eilancosman/tide\x1ejethrokuan/z\x1ejoseluisq/gitnow\x1e2m/fish\x2dgpg\x2dtty\x1eoh\x2dmy\x2dfish/plugin\x2ddirenv -SETUVAR _tide_prompt_26778:\x1b\x5bm\x1b\x5bm\x1b\x5bm\x20\x1b\x5bm\x1b\x5bm\x1b\x5b38\x3b2\x3b68\x3b136\x3b62m\u2b22\x2014\x2e18\x2e1\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\x20\x1b\x5bm\x1b\x5bm\x1b\x5b38\x3b2\x3b0\x3b175\x3b175m\ue73c\x20ff\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\x20\x1b\x5bm\x1b\x5bm\x1b\x5b38\x3b2\x3b50\x3b108\x3b229m\u2388\x20arn\x3aaws\x3aeks\x3aus\x2deast\x2d1\x3a039695438637\x3acluster/cloud100\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\x20\x1b\x5bm\x1b\x5bm\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m22\x3a49\x3a54\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1e\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1b\x5bm\uf30c\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\x20\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1b\x5b38\x3b2\x3b0\x3b135\x3b175m\uf07c\x20\x1b\x5b1m\x1b\x5b38\x3b2\x3b0\x3b175\x3b255m\x7e\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1b\x5b38\x3b2\x3b0\x3b135\x3b175m/\x1b\x5b38\x3b2\x3b135\x3b135\x3b175ms\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1b\x5b38\x3b2\x3b0\x3b135\x3b175m/\x1b\x5b38\x3b2\x3b135\x3b135\x3b175mgith\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1b\x5b38\x3b2\x3b0\x3b135\x3b175m/\x1b\x5b38\x3b2\x3b135\x3b135\x3b175m1\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1b\x5b38\x3b2\x3b0\x3b135\x3b175m/\x1b\x5b1m\x1b\x5b38\x3b2\x3b0\x3b175\x3b255mfifteen5\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1b\x5b38\x3b2\x3b0\x3b135\x3b175m\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\x20\x1b\x5bm\x1b\x5bm\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\uf1d3\x20\x1b\x5b38\x3b5\x3b7m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0mdev\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x20\x2a9\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x20\x214\x1b\x5b38\x3b2\x3b0\x3b175\x3b255m\x20\x3f2\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\u276f\x1b\x5bm\x1b\x5bm\x1b\x5bm\x20\x1b\x5bm\x20 -SETUVAR _tide_prompt_27557:\x1b\x5bm\x1b\x5bm\x1b\x5bm\x20\x1b\x5bm\x1b\x5bm\x1b\x5b38\x3b2\x3b50\x3b108\x3b229m\u2388\x20arn\x3aaws\x3aeks\x3aus\x2deast\x2d1\x3a039695438637\x3acluster/cloud100\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\x20\x1b\x5bm\x1b\x5bm\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m22\x3a50\x3a14\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1e\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1b\x5bm\uf30c\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\x20\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1b\x5b38\x3b2\x3b0\x3b135\x3b175m\uf07c\x20\x1b\x5b1m\x1b\x5b38\x3b2\x3b0\x3b175\x3b255m\x7e\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1b\x5b38\x3b2\x3b0\x3b135\x3b175m/\x1b\x5b1m\x1b\x5b38\x3b2\x3b0\x3b175\x3b255m\x2edotfiles\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1b\x5b38\x3b2\x3b0\x3b135\x3b175m/\x1b\x5b38\x3b2\x3b135\x3b135\x3b175mfi\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1b\x5b38\x3b2\x3b0\x3b135\x3b175m/\x1b\x5b38\x3b2\x3b135\x3b135\x3b175m\x2e\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1b\x5b38\x3b2\x3b0\x3b135\x3b175m/\x1b\x5b1m\x1b\x5b38\x3b2\x3b0\x3b175\x3b255mfish\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1b\x5b38\x3b2\x3b0\x3b135\x3b175m\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\x20\x1b\x5bm\x1b\x5bm\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\uf1d3\x20\x1b\x5b38\x3b5\x3b7m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0mmaster\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x20\x2a2\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x20\x2b15\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x20\x2118\x1b\x5b38\x3b2\x3b0\x3b175\x3b255m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\u276f\x1b\x5bm\x1b\x5bm\x1b\x5bm\x20\x1b\x5bm\x20 -SETUVAR _tide_prompt_28787:\x1b\x5bm\x1b\x5bm\x1b\x5bm\x20\x1b\x5bm\x1b\x5bm\x1b\x5b38\x3b2\x3b50\x3b108\x3b229m\u2388\x20arn\x3aaws\x3aeks\x3aus\x2deast\x2d1\x3a039695438637\x3acluster/cloud100\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\x20\x1b\x5bm\x1b\x5bm\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m22\x3a49\x3a57\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1e\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1b\x5bm\uf30c\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\x20\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1b\x5b38\x3b2\x3b0\x3b135\x3b175m\uf07c\x20/\x1b\x5b1m\x1b\x5b38\x3b2\x3b0\x3b175\x3b255musr\x7e\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1b\x5b38\x3b2\x3b0\x3b135\x3b175m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\u276f\x1b\x5bm\x1b\x5bm\x1b\x5bm\x20\x1b\x5bm\x20 +SETUVAR _tide_prompt_26778:\x1b\x5bm\x1b\x5bm\x1b\x5bm\x20\x1b\x5bm\x1b\x5bm\x1b\x5b38\x3b2\x3b68\x3b136\x3b62m\u2b22\x2014\x2e18\x2e1\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\x20\x1b\x5bm\x1b\x5bm\x1b\x5b38\x3b2\x3b0\x3b175\x3b175m\ue73c\x20ff\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\x20\x1b\x5bm\x1b\x5bm\x1b\x5b38\x3b2\x3b50\x3b108\x3b229m\u2388\x20arn\x3aaws\x3aeks\x3aus\x2deast\x2d1\x3a039695438637\x3acluster/cloud100\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\x20\x1b\x5bm\x1b\x5bm\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m23\x3a14\x3a53\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1e\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1b\x5bm\uf30c\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\x20\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1b\x5b38\x3b2\x3b0\x3b135\x3b175m\uf07c\x20\x1b\x5b1m\x1b\x5b38\x3b2\x3b0\x3b175\x3b255m\x7e\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1b\x5b38\x3b2\x3b0\x3b135\x3b175m/src/github\x2ecom/15five/\x1b\x5b1m\x1b\x5b38\x3b2\x3b0\x3b175\x3b255mfifteen5\x1b\x5bm\x1b\x5bm\x1b\x5bm\x1b\x5b38\x3b2\x3b0\x3b135\x3b175m\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\x20\x1b\x5bm\x1b\x5bm\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\uf1d3\x20\x1b\x5b38\x3b5\x3b7m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0mdev\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x20\x2a9\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x20\x214\x1b\x5b38\x3b2\x3b0\x3b175\x3b255m\x20\x3f2\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\u276f\x1b\x5bm\x1b\x5bm\x1b\x5bm\x20\x1b\x5bm\x20 +SETUVAR _tide_prompt_27557:\x1b\x5bm\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b175\x3b0m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2714\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\ue0b3\x1b\x5b38\x3b2\x3b50\x3b108\x3b229m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\u2388\x20arn\x3aaws\x3aeks\x3aus\x2deast\x2d1\x3a039695438637\x3acluster/cloud100\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\ue0b3\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2023\x3a15\x3a51\x20\x1b\x5bm\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1b\x5bm\x1e\x1b\x5bm\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b238\x3b238\x3b238m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\uf30c\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\ue0b1\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x1b\x5bm\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b0\x3b135\x3b175m\uf07c\x20\x1b\x5b1m\x1b\x5b38\x3b2\x3b0\x3b175\x3b255m\x7e\x1b\x5bm\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b0\x3b135\x3b175m/\x1b\x5b1m\x1b\x5b38\x3b2\x3b0\x3b175\x3b255m\x2edotfiles\x1b\x5bm\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x1b\x5b38\x3b2\x3b0\x3b135\x3b175m\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\ue0b1\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\uf1d3\x20\x1b\x5b38\x3b5\x3b7m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0mmaster\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x20\x2a2\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x20\x219\x1b\x5b38\x3b2\x3b0\x3b175\x3b255m\x20\x3f62\x20\x1b\x5bm\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1b\x5bm\x20 SETUVAR _tide_var_list:tide_os_icon\x1eVIRTUAL_ENV_DISABLE_PROMPT\x1etide_character_color\x1etide_character_color_failure\x1etide_character_icon\x1etide_character_vi_icon_default\x1etide_character_vi_icon_replace\x1etide_character_vi_icon_visual\x1etide_chruby_bg_color\x1etide_chruby_color\x1etide_chruby_icon\x1etide_cmd_duration_bg_color\x1etide_cmd_duration_color\x1etide_cmd_duration_decimals\x1etide_cmd_duration_icon\x1etide_cmd_duration_threshold\x1etide_context_always_display\x1etide_context_bg_color\x1etide_context_color_default\x1etide_context_color_root\x1etide_context_color_ssh\x1etide_git_bg_color\x1etide_git_bg_color_unstable\x1etide_git_bg_color_urgent\x1etide_git_color_branch\x1etide_git_color_conflicted\x1etide_git_color_dirty\x1etide_git_color_operation\x1etide_git_color_staged\x1etide_git_color_stash\x1etide_git_color_untracked\x1etide_git_color_upstream\x1etide_git_icon\x1etide_go_bg_color\x1etide_go_color\x1etide_go_icon\x1etide_jobs_bg_color\x1etide_jobs_color\x1etide_jobs_icon\x1etide_kubectl_bg_color\x1etide_kubectl_color\x1etide_kubectl_icon\x1etide_left_prompt_frame_enabled\x1etide_left_prompt_items\x1etide_left_prompt_prefix\x1etide_left_prompt_separator_diff_color\x1etide_left_prompt_separator_same_color\x1etide_left_prompt_suffix\x1etide_node_bg_color\x1etide_node_color\x1etide_node_icon\x1etide_os_bg_color\x1etide_os_color\x1etide_os_icon\x1etide_php_bg_color\x1etide_php_color\x1etide_php_icon\x1etide_prompt_add_newline_before\x1etide_prompt_color_frame_and_connection\x1etide_prompt_color_separator_same_color\x1etide_prompt_icon_connection\x1etide_prompt_min_cols\x1etide_prompt_pad_items\x1etide_pwd_bg_color\x1etide_pwd_color_anchors\x1etide_pwd_color_dirs\x1etide_pwd_color_truncated_dirs\x1etide_pwd_icon\x1etide_pwd_icon_home\x1etide_pwd_icon_unwritable\x1etide_pwd_markers\x1etide_right_prompt_frame_enabled\x1etide_right_prompt_items\x1etide_right_prompt_prefix\x1etide_right_prompt_separator_diff_color\x1etide_right_prompt_separator_same_color\x1etide_right_prompt_suffix\x1etide_rustc_bg_color\x1etide_rustc_color\x1etide_rustc_icon\x1etide_shlvl_bg_color\x1etide_shlvl_color\x1etide_shlvl_icon\x1etide_shlvl_threshold\x1etide_status_bg_color\x1etide_status_bg_color_failure\x1etide_status_color\x1etide_status_color_failure\x1etide_status_icon\x1etide_status_icon_failure\x1etide_terraform_bg_color\x1etide_terraform_color\x1etide_terraform_icon\x1etide_time_bg_color\x1etide_time_color\x1etide_time_format\x1etide_vi_mode_bg_color_default\x1etide_vi_mode_bg_color_replace\x1etide_vi_mode_bg_color_visual\x1etide_vi_mode_color_default\x1etide_vi_mode_color_replace\x1etide_vi_mode_color_visual\x1etide_vi_mode_icon_default\x1etide_vi_mode_icon_replace\x1etide_vi_mode_icon_visual\x1etide_virtual_env_bg_color\x1etide_virtual_env_color\x1etide_virtual_env_icon SETUVAR fish_color_autosuggestion:555\x1ebrblack SETUVAR fish_color_cancel:\x2dr @@ -51,22 +50,22 @@ SETUVAR tide_character_icon:\u276f SETUVAR tide_character_vi_icon_default:\u276e SETUVAR tide_character_vi_icon_replace:\u25b6 SETUVAR tide_character_vi_icon_visual:V -SETUVAR tide_chruby_bg_color:normal +SETUVAR tide_chruby_bg_color:303030 SETUVAR tide_chruby_color:B31209 SETUVAR tide_chruby_icon:\ue23e -SETUVAR tide_cmd_duration_bg_color:normal +SETUVAR tide_cmd_duration_bg_color:303030 SETUVAR tide_cmd_duration_color:87875F SETUVAR tide_cmd_duration_decimals:0 SETUVAR tide_cmd_duration_icon:\uf252 SETUVAR tide_cmd_duration_threshold:3000 SETUVAR tide_context_always_display:false -SETUVAR tide_context_bg_color:normal +SETUVAR tide_context_bg_color:303030 SETUVAR tide_context_color_default:D7AF87 SETUVAR tide_context_color_root:D7AF00 SETUVAR tide_context_color_ssh:D7AF87 -SETUVAR tide_git_bg_color:normal -SETUVAR tide_git_bg_color_unstable:normal -SETUVAR tide_git_bg_color_urgent:normal +SETUVAR tide_git_bg_color:303030 +SETUVAR tide_git_bg_color_unstable:303030 +SETUVAR tide_git_bg_color_urgent:303030 SETUVAR tide_git_color_branch:5FD700 SETUVAR tide_git_color_conflicted:FF0000 SETUVAR tide_git_color_dirty:D7AF00 @@ -76,37 +75,37 @@ SETUVAR tide_git_color_stash:5FD700 SETUVAR tide_git_color_untracked:00AFFF SETUVAR tide_git_color_upstream:5FD700 SETUVAR tide_git_icon:\uf1d3 -SETUVAR tide_go_bg_color:normal +SETUVAR tide_go_bg_color:303030 SETUVAR tide_go_color:00ACD7 SETUVAR tide_go_icon:\ue627 -SETUVAR tide_jobs_bg_color:normal +SETUVAR tide_jobs_bg_color:303030 SETUVAR tide_jobs_color:5FAF00 SETUVAR tide_jobs_icon:\uf013 -SETUVAR tide_kubectl_bg_color:normal +SETUVAR tide_kubectl_bg_color:303030 SETUVAR tide_kubectl_color:326CE5 SETUVAR tide_kubectl_icon:\u2388 SETUVAR tide_left_prompt_frame_enabled:false -SETUVAR tide_left_prompt_items:os\x1epwd\x1egit\x1echaracter -SETUVAR tide_left_prompt_prefix: -SETUVAR tide_left_prompt_separator_diff_color:\x20 -SETUVAR tide_left_prompt_separator_same_color:\x20 -SETUVAR tide_left_prompt_suffix:\x20 -SETUVAR tide_node_bg_color:normal +SETUVAR tide_left_prompt_items:os\x1epwd\x1egit +SETUVAR tide_left_prompt_prefix:\ue0b2 +SETUVAR tide_left_prompt_separator_diff_color:\ue0b0 +SETUVAR tide_left_prompt_separator_same_color:\ue0b1 +SETUVAR tide_left_prompt_suffix:\ue0b0 +SETUVAR tide_node_bg_color:303030 SETUVAR tide_node_color:44883E SETUVAR tide_node_icon:\u2b22 -SETUVAR tide_os_bg_color:normal -SETUVAR tide_os_color:normal +SETUVAR tide_os_bg_color:303030 +SETUVAR tide_os_color:EEEEEE SETUVAR tide_os_icon:\uf30c -SETUVAR tide_php_bg_color:normal +SETUVAR tide_php_bg_color:303030 SETUVAR tide_php_color:617CBE SETUVAR tide_php_icon:\ue608 -SETUVAR tide_prompt_add_newline_before:true +SETUVAR tide_prompt_add_newline_before:false SETUVAR tide_prompt_color_frame_and_connection:6C6C6C SETUVAR tide_prompt_color_separator_same_color:949494 SETUVAR tide_prompt_icon_connection:\x20 SETUVAR tide_prompt_min_cols:26 -SETUVAR tide_prompt_pad_items:false -SETUVAR tide_pwd_bg_color:normal +SETUVAR tide_prompt_pad_items:true +SETUVAR tide_pwd_bg_color:303030 SETUVAR tide_pwd_color_anchors:00AFFF SETUVAR tide_pwd_color_dirs:0087AF SETUVAR tide_pwd_color_truncated_dirs:8787AF @@ -115,39 +114,39 @@ SETUVAR tide_pwd_icon_home:\uf015 SETUVAR tide_pwd_icon_unwritable:\uf023 SETUVAR tide_pwd_markers:\x2ebzr\x1e\x2ecitc\x1e\x2egit\x1e\x2ehg\x1e\x2enode\x2dversion\x1e\x2epython\x2dversion\x1e\x2eruby\x2dversion\x1e\x2eshorten_folder_marker\x1e\x2esvn\x1e\x2eterraform\x1eCargo\x2etoml\x1ecomposer\x2ejson\x1eCVS\x1ego\x2emod\x1epackage\x2ejson SETUVAR tide_right_prompt_frame_enabled:false -SETUVAR tide_right_prompt_items:status\x1ecmd_duration\x1econtext\x1ejobs\x1enode\x1evirtual_env\x1erustc\x1ephp\x1ego\x1ekubectl\x1etime -SETUVAR tide_right_prompt_prefix:\x20 -SETUVAR tide_right_prompt_separator_diff_color:\x20 -SETUVAR tide_right_prompt_separator_same_color:\x20 -SETUVAR tide_right_prompt_suffix: -SETUVAR tide_rustc_bg_color:normal +SETUVAR tide_right_prompt_items:status\x1ecmd_duration\x1econtext\x1ejobs\x1enode\x1evirtual_env\x1erustc\x1ephp\x1ego\x1ekubectl\x1evi_mode\x1etime +SETUVAR tide_right_prompt_prefix:\ue0b2 +SETUVAR tide_right_prompt_separator_diff_color:\ue0b2 +SETUVAR tide_right_prompt_separator_same_color:\ue0b3 +SETUVAR tide_right_prompt_suffix:\ue0b0 +SETUVAR tide_rustc_bg_color:303030 SETUVAR tide_rustc_color:F74C00 SETUVAR tide_rustc_icon:\ue7a8 -SETUVAR tide_shlvl_bg_color:normal +SETUVAR tide_shlvl_bg_color:303030 SETUVAR tide_shlvl_color:d78700 SETUVAR tide_shlvl_icon:\uf120 SETUVAR tide_shlvl_threshold:1 -SETUVAR tide_status_bg_color:normal -SETUVAR tide_status_bg_color_failure:normal +SETUVAR tide_status_bg_color:303030 +SETUVAR tide_status_bg_color_failure:303030 SETUVAR tide_status_color:5FAF00 SETUVAR tide_status_color_failure:D70000 SETUVAR tide_status_icon:\u2714 SETUVAR tide_status_icon_failure:\u2718 -SETUVAR tide_terraform_bg_color:normal +SETUVAR tide_terraform_bg_color:303030 SETUVAR tide_terraform_color:844FBA SETUVAR tide_terraform_icon:\x1d -SETUVAR tide_time_bg_color:normal +SETUVAR tide_time_bg_color:303030 SETUVAR tide_time_color:5F8787 SETUVAR tide_time_format:\x25T -SETUVAR tide_vi_mode_bg_color_default:\x1d -SETUVAR tide_vi_mode_bg_color_replace:\x1d -SETUVAR tide_vi_mode_bg_color_visual:\x1d -SETUVAR tide_vi_mode_color_default:\x1d -SETUVAR tide_vi_mode_color_replace:\x1d -SETUVAR tide_vi_mode_color_visual:\x1d -SETUVAR tide_vi_mode_icon_default:\x1d -SETUVAR tide_vi_mode_icon_replace:\x1d -SETUVAR tide_vi_mode_icon_visual:\x1d -SETUVAR tide_virtual_env_bg_color:normal +SETUVAR tide_vi_mode_bg_color_default:303030 +SETUVAR tide_vi_mode_bg_color_replace:303030 +SETUVAR tide_vi_mode_bg_color_visual:303030 +SETUVAR tide_vi_mode_color_default:87af00 +SETUVAR tide_vi_mode_color_replace:d78700 +SETUVAR tide_vi_mode_color_visual:5f87d7 +SETUVAR tide_vi_mode_icon_default:DEFAULT +SETUVAR tide_vi_mode_icon_replace:REPLACE +SETUVAR tide_vi_mode_icon_visual:VISUAL +SETUVAR tide_virtual_env_bg_color:303030 SETUVAR tide_virtual_env_color:00AFAF SETUVAR tide_virtual_env_icon:\ue73c diff --git a/fish/.config/fish/functions/_tide_cache_variables.fish b/fish/.config/fish/functions/_tide_cache_variables.fish new file mode 100644 index 0000000..f4df519 --- /dev/null +++ b/fish/.config/fish/functions/_tide_cache_variables.fish @@ -0,0 +1,18 @@ +function _tide_cache_variables + # pwd + set -gx _tide_color_anchors (set_color -o $tide_pwd_color_anchors) + set -gx _tide_color_truncated_dirs (set_color $tide_pwd_color_truncated_dirs || echo) + set -gx _tide_reset_to_color_dirs (set_color normal -b $tide_pwd_bg_color; set_color $tide_pwd_color_dirs) + + # git + contains git $tide_left_prompt_items $tide_right_prompt_items && + set -gx _tide_location_color (set_color $tide_git_color_branch || echo) + + # two line prompt + contains newline $tide_left_prompt_items && + set -gx _tide_prompt_and_frame_color (set_color $tide_prompt_color_frame_and_connection -b normal) + + # newline before + set -e _tide_add_newline + test "$tide_prompt_add_newline_before" = true && set -g _tide_add_newline '' +end diff --git a/fish/.config/fish/functions/_tide_detect_os.fish b/fish/.config/fish/functions/_tide_detect_os.fish new file mode 100644 index 0000000..4526920 --- /dev/null +++ b/fish/.config/fish/functions/_tide_detect_os.fish @@ -0,0 +1,47 @@ +function _tide_detect_os + switch (uname | string lower) + case darwin + printf '%s'  + case freebsd openbsd dragonfly + printf '%s'  + case linux + _tide_detect_os_linux_cases /etc/os-release ID || + _tide_detect_os_linux_cases /etc/os-release ID_LIKE || + _tide_detect_os_linux_cases /etc/lsb-release DISTRIB_ID || + printf '%s'  + case '*' + printf '%s' '?' + end +end + +function _tide_detect_os_linux_cases -a file key + test -e $file || return + set -l split_file (string split '=' <$file) + set -l key_index (contains --index $key $split_file) || return + set -l value (string trim --chars='"' $split_file[(math $key_index + 1)] | string lower) + + set -l distro_icons \ + alpine  \ + aosc  \ + arch  \ + centos  \ + coreos  \ + debian  \ + devuan  \ + elementary  \ + fedora  \ + gentoo  \ + mageia  \ + manjaro  \ + mint  \ + nixos  \ + opensuse  \ + raspbian  \ + sabayon  \ + slackware  \ + tumbleweed  \ + ubuntu  + + set -l distro_index (contains --index $value $distro_icons) || return + printf '%s' $distro_icons[(math $distro_index + 1)] +end diff --git a/fish/.config/fish/functions/_tide_find_and_remove.fish b/fish/.config/fish/functions/_tide_find_and_remove.fish new file mode 100644 index 0000000..e49d0bb --- /dev/null +++ b/fish/.config/fish/functions/_tide_find_and_remove.fish @@ -0,0 +1,3 @@ +function _tide_find_and_remove -a name list --no-scope-shadowing + set -l index (contains --index $name $$list) && set -e "$list"[$index] +end diff --git a/fish/.config/fish/functions/_tide_item_character.fish b/fish/.config/fish/functions/_tide_item_character.fish new file mode 100644 index 0000000..e6bcb57 --- /dev/null +++ b/fish/.config/fish/functions/_tide_item_character.fish @@ -0,0 +1,22 @@ +function _tide_item_character + if test $_tide_last_status = 0 + set_color $tide_character_color + else + set_color $tide_character_color_failure + end + + if test "$fish_key_bindings" = fish_default_key_bindings + printf %s $tide_character_icon + else + switch $fish_bind_mode + case insert + printf %s $tide_character_icon + case default + printf %s $tide_character_vi_icon_default + case replace replace_one + printf %s $tide_character_vi_icon_replace + case visual + printf %s $tide_character_vi_icon_visual + end + end +end diff --git a/fish/.config/fish/functions/_tide_item_chruby.fish b/fish/.config/fish/functions/_tide_item_chruby.fish new file mode 100644 index 0000000..02d5fbd --- /dev/null +++ b/fish/.config/fish/functions/_tide_item_chruby.fish @@ -0,0 +1,3 @@ +function _tide_item_chruby + test -n "$RUBY_VERSION" && _tide_print_item chruby $tide_chruby_icon' ' $RUBY_VERSION +end diff --git a/fish/.config/fish/functions/_tide_item_cmd_duration.fish b/fish/.config/fish/functions/_tide_item_cmd_duration.fish new file mode 100644 index 0000000..cffb682 --- /dev/null +++ b/fish/.config/fish/functions/_tide_item_cmd_duration.fish @@ -0,0 +1,15 @@ +function _tide_item_cmd_duration + if test $CMD_DURATION -gt $tide_cmd_duration_threshold + set -l seconds (math --scale=$tide_cmd_duration_decimals "$CMD_DURATION/1000" % 60) + set -l minutes (math --scale=0 "$CMD_DURATION/60000" % 60) + set -l hours (math --scale=0 "$CMD_DURATION/3600000") + + if test $hours != 0 + _tide_print_item cmd_duration $tide_cmd_duration_icon' ' $hours'h ' $minutes'm ' $seconds's' + else if test $minutes != 0 + _tide_print_item cmd_duration $tide_cmd_duration_icon' ' $minutes'm ' $seconds's' + else if test $seconds != 0 + _tide_print_item cmd_duration $tide_cmd_duration_icon' ' $seconds's' + end + end +end diff --git a/fish/.config/fish/functions/_tide_item_context.fish b/fish/.config/fish/functions/_tide_item_context.fish new file mode 100644 index 0000000..84d1ba0 --- /dev/null +++ b/fish/.config/fish/functions/_tide_item_context.fish @@ -0,0 +1,9 @@ +function _tide_item_context + if set -q SSH_TTY + tide_context_color=$tide_context_color_ssh _tide_print_item context $USER'@'$hostname + else if contains -- $USER root toor Administrator + tide_context_color=$tide_context_color_root _tide_print_item context $USER'@'$hostname + else if test "$tide_context_always_display" = true + tide_context_color=$tide_context_color_default _tide_print_item context $USER'@'$hostname + end +end diff --git a/fish/.config/fish/functions/_tide_item_git.fish b/fish/.config/fish/functions/_tide_item_git.fish new file mode 100644 index 0000000..134fc87 --- /dev/null +++ b/fish/.config/fish/functions/_tide_item_git.fish @@ -0,0 +1,71 @@ +function _tide_item_git + set -l location $_tide_location_color(git branch --show-current 2>/dev/null) || return + # --quiet = don't error if there are no commits + git rev-parse --quiet --git-dir --is-inside-git-dir --short HEAD | + read --local --line git_dir is_inside_git_dir sha + + if test -z "$location" # Default to branch, then tag, then sha + set location '#'$_tide_location_color(git tag --points-at HEAD)[1] # get the first tag + test -z "$location" && set location '@'$_tide_location_color$sha + end + + # Operation + if test -d $git_dir/rebase-merge + read tide_git_step <$git_dir/rebase-merge/msgnum + read tide_git_total_steps <$git_dir/rebase-merge/end + if test -f $git_dir/rebase-merge/interactive + set tide_git_operation rebase-i + else + set tide_git_operation rebase-m + end + else if test -d $git_dir/rebase-apply + read tide_git_step <$git_dir/rebase-apply/next + read tide_git_total_steps <$git_dir/rebase-apply/last + if test -f $git_dir/rebase-apply/rebasing + set tide_git_operation rebase + else if test -f $git_dir/rebase-apply/applying + set tide_git_operation am + else + set tide_git_operation am/rebase + end + else if test -f $git_dir/MERGE_HEAD + set tide_git_operation merge + else if test -f $git_dir/CHERRY_PICK_HEAD + set tide_git_operation cherry-pick + else if test -f $git_dir/REVERT_HEAD + set tide_git_operation revert + else if test -f $git_dir/BISECT_LOG + set tide_git_operation bisect + end + + # Upstream behind/ahead. Suppress errors in case there is no upstream + git rev-list --count --left-right @{upstream}...HEAD 2>/dev/null | + read --local --delimiter=\t upstream_behind upstream_ahead + test "$upstream_behind" = 0 && set -e upstream_behind + test "$upstream_ahead" = 0 && set -e upstream_ahead + + # Git status/stash + test "$is_inside_git_dir" = true && set -l tide_git_set_dir_option -C $git_dir/.. + # Suppress errors in case we are in a bare repo + set -l git_info (git $tide_git_set_dir_option --no-optional-locks status --porcelain 2>/dev/null) + set -l stash (git $tide_git_set_dir_option stash list 2>/dev/null | count) || set -e stash + set -l conflicted (string match --regex '^UU' $git_info | count) || set -e conflicted + set -l staged (string match --regex '^[ADMR].' $git_info | count) || set -e staged + set -l dirty (string match --regex '^.[ADMR]' $git_info | count) || set -e dirty + set -l untracked (string match --regex '^\?\?' $git_info | count) || set -e untracked + + if set -q tide_git_operation || set -q conflicted + set -g tide_git_bg_color $tide_git_bg_color_urgent + else if set -q staged || set -q dirty || set -q untracked + set -g tide_git_bg_color $tide_git_bg_color_unstable + end + + _tide_print_item git $_tide_location_color $tide_git_icon' ' (set_color white; printf %s $location + set_color $tide_git_color_operation; printf %s ' '$tide_git_operation ' '$tide_git_step/$tide_git_total_steps + set_color $tide_git_color_upstream; printf %s ' ⇣'$upstream_behind ' ⇡'$upstream_ahead + set_color $tide_git_color_stash; printf %s ' *'$stash + set_color $tide_git_color_conflicted; printf %s ' ~'$conflicted + set_color $tide_git_color_staged; printf %s ' +'$staged + set_color $tide_git_color_dirty; printf %s ' !'$dirty + set_color $tide_git_color_untracked; printf %s ' ?'$untracked) +end diff --git a/fish/.config/fish/functions/_tide_item_go.fish b/fish/.config/fish/functions/_tide_item_go.fish new file mode 100644 index 0000000..2138a2b --- /dev/null +++ b/fish/.config/fish/functions/_tide_item_go.fish @@ -0,0 +1,3 @@ +function _tide_item_go + test -e go.mod && _tide_print_item go $tide_go_icon' ' (go version | string match --regex "[\d.]+") +end diff --git a/fish/.config/fish/functions/_tide_item_jobs.fish b/fish/.config/fish/functions/_tide_item_jobs.fish new file mode 100644 index 0000000..6910a64 --- /dev/null +++ b/fish/.config/fish/functions/_tide_item_jobs.fish @@ -0,0 +1,3 @@ +function _tide_item_jobs + test $_tide_jobs_status = 0 && _tide_print_item jobs $tide_jobs_icon +end diff --git a/fish/.config/fish/functions/_tide_item_kubectl.fish b/fish/.config/fish/functions/_tide_item_kubectl.fish new file mode 100644 index 0000000..7987330 --- /dev/null +++ b/fish/.config/fish/functions/_tide_item_kubectl.fish @@ -0,0 +1,4 @@ +function _tide_item_kubectl + set -l context (kubectl config view --minify --output 'jsonpath={.current-context}/{..namespace}' 2>/dev/null) && + _tide_print_item kubectl $tide_kubectl_icon' ' (string replace --regex '/(|default)$' '' $context) +end diff --git a/fish/.config/fish/functions/_tide_item_newline.fish b/fish/.config/fish/functions/_tide_item_newline.fish new file mode 100644 index 0000000..0eeb233 --- /dev/null +++ b/fish/.config/fish/functions/_tide_item_newline.fish @@ -0,0 +1,5 @@ +function _tide_item_newline + set_color $_tide_previous_bg_color -b normal + side_working_on_suffix_name=tide_"$_tide_which_side_working_on"_prompt_suffix printf '%s' $$side_working_on_suffix_name \n + set -g _tide_last_item_was_newline +end diff --git a/fish/.config/fish/functions/_tide_item_node.fish b/fish/.config/fish/functions/_tide_item_node.fish new file mode 100644 index 0000000..90a929b --- /dev/null +++ b/fish/.config/fish/functions/_tide_item_node.fish @@ -0,0 +1,3 @@ +function _tide_item_node + test -e package.json && _tide_print_item node $tide_node_icon' ' (node --version | string trim --chars=v) +end diff --git a/fish/.config/fish/functions/_tide_item_os.fish b/fish/.config/fish/functions/_tide_item_os.fish new file mode 100644 index 0000000..8a6208c --- /dev/null +++ b/fish/.config/fish/functions/_tide_item_os.fish @@ -0,0 +1,3 @@ +function _tide_item_os + _tide_print_item os $tide_os_icon +end diff --git a/fish/.config/fish/functions/_tide_item_php.fish b/fish/.config/fish/functions/_tide_item_php.fish new file mode 100644 index 0000000..3aad466 --- /dev/null +++ b/fish/.config/fish/functions/_tide_item_php.fish @@ -0,0 +1,3 @@ +function _tide_item_php + test -e composer.json && _tide_print_item php $tide_php_icon' ' (php --version | string match --regex 'PHP ([\d.]+)')[2] +end diff --git a/fish/.config/fish/functions/_tide_item_rustc.fish b/fish/.config/fish/functions/_tide_item_rustc.fish new file mode 100644 index 0000000..b898e6f --- /dev/null +++ b/fish/.config/fish/functions/_tide_item_rustc.fish @@ -0,0 +1,3 @@ +function _tide_item_rustc + test -e Cargo.toml && _tide_print_item rustc $tide_rustc_icon' ' (rustc --version | string split ' ')[2] +end diff --git a/fish/.config/fish/functions/_tide_item_shlvl.fish b/fish/.config/fish/functions/_tide_item_shlvl.fish new file mode 100644 index 0000000..95dd5ff --- /dev/null +++ b/fish/.config/fish/functions/_tide_item_shlvl.fish @@ -0,0 +1,4 @@ +function _tide_item_shlvl + # Non-interactive shells do not increment SHLVL, so we don't need to subtract 1 + test $SHLVL -gt $tide_shlvl_threshold && _tide_print_item shlvl $tide_shlvl_icon' ' $SHLVL +end diff --git a/fish/.config/fish/functions/_tide_item_status.fish b/fish/.config/fish/functions/_tide_item_status.fish new file mode 100644 index 0000000..5176ba9 --- /dev/null +++ b/fish/.config/fish/functions/_tide_item_status.fish @@ -0,0 +1,20 @@ +function _tide_item_status + # Variables are exported as strings, convert _tide_last_pipestatus back into a list + set -l _tide_last_pipestatus (string split ' ' $_tide_last_pipestatus) + + if string match --quiet --invert 0 $_tide_last_pipestatus # If there is a failure anywhere in the pipestatus + if test "$_tide_last_pipestatus" = 1 # If simple failure + contains character $tide_left_prompt_items || tide_status_bg_color=$tide_status_bg_color_failure \ + tide_status_color=$tide_status_color_failure _tide_print_item status $tide_status_icon_failure' ' 1 + else if test $_tide_last_status = 0 + _tide_print_item status $tide_status_icon' ' \ + (fish_status_to_signal $_tide_last_pipestatus | string replace SIG '' | string join '|') + else + tide_status_bg_color=$tide_status_bg_color_failure tide_status_color=$tide_status_color_failure \ + _tide_print_item status $tide_status_icon_failure' ' \ + (fish_status_to_signal $_tide_last_pipestatus | string replace SIG '' | string join '|') + end + else if not contains character $tide_left_prompt_items + _tide_print_item status $tide_status_icon + end +end diff --git a/fish/.config/fish/functions/_tide_item_terraform.fish b/fish/.config/fish/functions/_tide_item_terraform.fish new file mode 100644 index 0000000..60fd3fb --- /dev/null +++ b/fish/.config/fish/functions/_tide_item_terraform.fish @@ -0,0 +1,6 @@ +function _tide_item_terraform + if test -d .terraform + terraform workspace show | read -l workspace + test $workspace != default && _tide_print_item terraform $tide_terraform_icon' ' $workspace + end +end diff --git a/fish/.config/fish/functions/_tide_item_time.fish b/fish/.config/fish/functions/_tide_item_time.fish new file mode 100644 index 0000000..b8522bc --- /dev/null +++ b/fish/.config/fish/functions/_tide_item_time.fish @@ -0,0 +1,3 @@ +function _tide_item_time + _tide_print_item time (date +$tide_time_format) +end diff --git a/fish/.config/fish/functions/_tide_item_vi_mode.fish b/fish/.config/fish/functions/_tide_item_vi_mode.fish new file mode 100644 index 0000000..c3c4230 --- /dev/null +++ b/fish/.config/fish/functions/_tide_item_vi_mode.fish @@ -0,0 +1,13 @@ +function _tide_item_vi_mode + test "$fish_key_bindings" != fish_default_key_bindings && switch $fish_bind_mode + case default + tide_vi_mode_bg_color=$tide_vi_mode_bg_color_default tide_vi_mode_color=$tide_vi_mode_color_default \ + _tide_print_item vi_mode $tide_vi_mode_icon_default + case replace replace_one + tide_vi_mode_bg_color=$tide_vi_mode_bg_color_replace tide_vi_mode_color=$tide_vi_mode_color_replace \ + _tide_print_item vi_mode $tide_vi_mode_icon_replace + case visual + tide_vi_mode_bg_color=$tide_vi_mode_bg_color_visual tide_vi_mode_color=$tide_vi_mode_color_visual \ + _tide_print_item vi_mode $tide_vi_mode_icon_visual + end +end diff --git a/fish/.config/fish/functions/_tide_item_virtual_env.fish b/fish/.config/fish/functions/_tide_item_virtual_env.fish new file mode 100644 index 0000000..d01f59d --- /dev/null +++ b/fish/.config/fish/functions/_tide_item_virtual_env.fish @@ -0,0 +1,12 @@ +function _tide_item_virtual_env + set -l split_virtual_env (string split / "$VIRTUAL_ENV") && + if test $split_virtual_env[-2] = virtualenvs + # pipenv $VIRTUAL_ENV looks like /home/ilan/.local/share/virtualenvs/pipenv_project-EwRYuc3l + # Detect whether we are using pipenv by looking for virtualenvs. If so, remove the hash at the end. + _tide_print_item virtual_env $tide_virtual_env_icon' ' (string split -r -m1 - "$split_virtual_env[-1]")[1] + else if contains -- $split_virtual_env[-1] virtualenv venv .venv env # avoid generic names + _tide_print_item virtual_env $tide_virtual_env_icon' ' $split_virtual_env[-2] + else + _tide_print_item virtual_env $tide_virtual_env_icon' ' $split_virtual_env[-1] + end +end diff --git a/fish/.config/fish/functions/_tide_print_item.fish b/fish/.config/fish/functions/_tide_print_item.fish new file mode 100644 index 0000000..59f9604 --- /dev/null +++ b/fish/.config/fish/functions/_tide_print_item.fish @@ -0,0 +1,35 @@ +function _tide_print_item -a item + item_bg_color_name=tide_"$item"_bg_color set item_bg_color $$item_bg_color_name + + if test "$_tide_which_side_working_on" = left + if set -e _tide_last_item_was_newline + set_color $item_bg_color -b normal + printf '%s' $tide_left_prompt_prefix + else if test "$item_bg_color" = "$_tide_previous_bg_color" + set_color $tide_prompt_color_separator_same_color + printf '%s' $tide_left_prompt_separator_same_color + else + set_color $_tide_previous_bg_color -b $item_bg_color + printf '%s' $tide_left_prompt_separator_diff_color + end + else if set -e _tide_last_item_was_newline + set_color $item_bg_color -b normal + printf '%s' $tide_right_prompt_prefix + else if test "$item_bg_color" = "$_tide_previous_bg_color" + set_color $tide_prompt_color_separator_same_color + printf '%s' $tide_right_prompt_separator_same_color + else + set_color $item_bg_color -b $_tide_previous_bg_color + printf '%s' $tide_right_prompt_separator_diff_color + end + + item_color_name=tide_"$item"_color set_color $$item_color_name -b $item_bg_color + + if test "$tide_prompt_pad_items" = true + printf '%s' ' ' $argv[2..] ' ' + else + printf '%s' $argv[2..] + end + + set -g _tide_previous_bg_color $item_bg_color +end diff --git a/fish/.config/fish/functions/_tide_prompt.fish b/fish/.config/fish/functions/_tide_prompt.fish new file mode 100644 index 0000000..35b6a34 --- /dev/null +++ b/fish/.config/fish/functions/_tide_prompt.fish @@ -0,0 +1,61 @@ +function _tide_prompt + left_prompt=(_tide_left_prompt) right_prompt=(_tide_right_prompt) if set -q left_prompt[2] # If prompt is two lines + if test "$tide_left_prompt_frame_enabled" = true + set left_prompt[1] $_tide_prompt_and_frame_color╭─"$left_prompt[1]" + set left_prompt[2] $_tide_prompt_and_frame_color╰─"$left_prompt[2]" + end + if test "$tide_right_prompt_frame_enabled" = true + set right_prompt[1] "$right_prompt[1]"$_tide_prompt_and_frame_color─╮ + set right_prompt[2] "$right_prompt[2]"$_tide_prompt_and_frame_color─╯ + end + + echo $right_prompt[2] + + set -lx dist_btwn_sides (math $COLUMNS + 5 - ( # Regex removes color. 5 = @PWD@ length which will be replaced + string replace -ar '\e(\[[\d;]*|\(B\e\[)m(\co)?' '' "$left_prompt[1]""$right_prompt[1]" | string length)) + printf '%s' (string replace @PWD@ (_tide_pwd) "$left_prompt[1]") $_tide_prompt_and_frame_color + + string repeat --no-newline --max (math max 0, $dist_btwn_sides - $pwd_length) $tide_prompt_icon_connection + printf '%s' $right_prompt[1] \n $left_prompt[2]' ' + else + echo $right_prompt[1] + + set -lx dist_btwn_sides (math $COLUMNS + 5 -$tide_prompt_min_cols - ( + string replace -ar '\e(\[[\d;]*|\(B\e\[)m(\co)?' '' "$left_prompt[1]""$right_prompt[1]" | string length)) + string replace @PWD@ (_tide_pwd) "$left_prompt[1] " + end +end + +function _tide_left_prompt + set -g _tide_last_item_was_newline + + _tide_which_side_working_on=left for item in $tide_left_prompt_items + _tide_item_$item + end + + if not set -e _tide_last_item_was_newline + set_color $_tide_previous_bg_color -b normal + printf '%s' $tide_left_prompt_suffix + end + + set_color normal # Make sure there is something printed on the last line +end + +function _tide_right_prompt + set -g _tide_last_item_was_newline + + _tide_which_side_working_on=right for item in $tide_right_prompt_items + _tide_item_$item + end + + if not set -e _tide_last_item_was_newline + set_color $_tide_previous_bg_color -b normal + printf '%s' $tide_right_prompt_suffix + end + + set_color normal # Make sure there is something printed on the last line +end + +function _tide_item_pwd + _tide_print_item pwd @PWD@ +end diff --git a/fish/.config/fish/functions/_tide_pwd.fish b/fish/.config/fish/functions/_tide_pwd.fish new file mode 100644 index 0000000..b1ad926 --- /dev/null +++ b/fish/.config/fish/functions/_tide_pwd.fish @@ -0,0 +1,44 @@ +function _tide_pwd + set -l split_pwd (string replace -- $HOME '~' $PWD | string split /) + set -l split_pwd_for_length $split_pwd + + # Anchor first and last directories (which may be the same) + if test -n "$split_pwd[1]" # ~/foo/bar, hightlight ~ + set split_pwd_for_output $_tide_color_anchors$split_pwd[1]$_tide_reset_to_color_dirs $split_pwd[2..] + else # /foo/bar, hightlight foo not empty string + set split_pwd_for_output '' $_tide_color_anchors$split_pwd[2]$_tide_reset_to_color_dirs $split_pwd[3..] + end + set split_pwd_for_output[-1] $_tide_color_anchors$split_pwd[-1]$_tide_reset_to_color_dirs + + if not test -w $PWD + set -g tide_pwd_icon $tide_pwd_icon_unwritable' ' + else if test $PWD = $HOME + set -g tide_pwd_icon $tide_pwd_icon_home' ' + else + set -g tide_pwd_icon $tide_pwd_icon' ' + end + + set -g pwd_length (string length "$tide_pwd_icon"(string join / $split_pwd_for_length)) + + i=1 for dir_section in $split_pwd[2..-2] + set -l parent_dir (string join -- / $split_pwd[..$i] | string replace '~' $HOME) # Uses i before increment + + set i (math $i + 1) + + # Returns true if any markers exist in dir_section + if test -z false (string split --max 2 " " -- "-o -e "$parent_dir/$dir_section/$tide_pwd_markers) + set split_pwd_for_output[$i] $_tide_color_anchors$dir_section$_tide_reset_to_color_dirs + else if test $pwd_length -gt $dist_btwn_sides + while set -l truncation_length (math $truncation_length + 1) && + set -l truncated (string sub --length $truncation_length -- $dir_section) && + test $truncated != $dir_section -a (count $parent_dir/$truncated*/) -gt 1 + end + set split_pwd_for_length[$i] $truncated + set split_pwd_for_output[$i] $_tide_color_truncated_dirs$truncated$_tide_reset_to_color_dirs + set pwd_length (string length "$tide_pwd_icon"(string join / $split_pwd_for_length)) # Update length + end + end + + printf '%s' $_tide_reset_to_color_dirs $tide_pwd_icon + string join -- / $split_pwd_for_output +end diff --git a/fish/.config/fish/functions/_tide_remove_unusable_items.fish b/fish/.config/fish/functions/_tide_remove_unusable_items.fish new file mode 100644 index 0000000..d885cf4 --- /dev/null +++ b/fish/.config/fish/functions/_tide_remove_unusable_items.fish @@ -0,0 +1,15 @@ +function _tide_remove_unusable_items + # Remove tool-specific items for tools the machine doesn't have installed + for item in chruby git go kubectl node php rustc terraform virtual_env + set -l cli_names $item + switch $item + case virtual_env + set cli_names python python3 + end + + if not type --query $cli_names + _tide_find_and_remove $item tide_left_prompt_items + _tide_find_and_remove $item tide_right_prompt_items + end + end +end diff --git a/fish/.config/fish/functions/_tide_sub_bug-report.fish b/fish/.config/fish/functions/_tide_sub_bug-report.fish new file mode 100644 index 0000000..6467803 --- /dev/null +++ b/fish/.config/fish/functions/_tide_sub_bug-report.fish @@ -0,0 +1,71 @@ +function _tide_sub_bug-report + argparse c/clean v/verbose -- $argv + + if set -q _flag_clean + HOME=(mktemp -d) fish --init-command "curl --silent \ + https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish | + source && fisher install ilancosman/tide@v5" + else if set -q _flag_verbose + set --long | string match --regex "^_?tide.*" | # Get only tide variables + string match --regex --invert "^_tide_prompt_var.*" | # Remove _tide_prompt_var + string match --regex --invert "^_tide_prompt_data.*" | # Remove _tide_prompt_data + string match --regex --invert "^_tide_var_list.*" # Remove _tide_var_list + else + set -l fish_version (fish --version | string match --regex "fish, version (\d\.\d\.\d)")[2] + _tide_check_version Fish fish-shell/fish-shell "(\d\.\d\.\d)" $fish_version || return + + set -l tide_version (tide --version | string match --regex "tide, version (\d\.\d\.\d)")[2] + _tide_check_version Tide IlanCosman/tide "v(\d\.\d\.\d)" $tide_version || return + + test (git --version | string match --regex "git version ([\d\.]*)" | string replace --all '.' '')[2] -gt 2220 + _tide_check_condition \ + "Your git version is too old." \ + "Tide requires at least version 2.22." \ + "Please update before submitting a bug report." || return + + # Check that omf is not installed + not functions --query omf + _tide_check_condition \ + "Tide does not work with oh-my-fish installed." \ + "Please uninstall it before submitting a bug report." || return + + set -l fish_startup_time (fish --command "time fish -c exit" 2>&1 | + string match --regex "Executed in(.*)fish" | string trim)[2] + + set -l fisher_plugins (string join ', ' $_fisher_plugins) + + read --local --prompt-str "What operating system are you using? (e.g Ubuntu 20.04): " os + read --local --prompt-str "What terminal emulator are you using? (e.g Kitty): " terminal_emulator + + printf '%b\n' "\nPlease copy the following information into the issue:\n" \ + "fish version: $fish_version" \ + "tide version: $tide_version" \ + "term: $TERM" \ + "os: $os" \ + "terminal emulator: $terminal_emulator" \ + "fish startup: $fish_startup_time" \ + "fisher plugins: $fisher_plugins" + end +end + +function _tide_check_version -a program_name repo_name regex_to_get_version current_version + curl --silent https://github.com/$repo_name/releases/latest | + string match --regex ".*$repo_name/releases/tag/$regex_to_get_version.*" | + read --local --line __ latestVersion + + string match --quiet --regex "^$latestVersion" "$current_version" + _tide_check_condition \ + "Your $program_name version is out of date." \ + "The latest is $latestVersion. You have $current_version." \ + "Please update before submitting a bug report." +end + +function _tide_check_condition + if test "$status" != 0 + set_color red + printf '%s\n' $argv + set_color normal + return 1 + end + return 0 +end diff --git a/fish/.config/fish/functions/_tide_sub_configure.fish b/fish/.config/fish/functions/_tide_sub_configure.fish new file mode 100644 index 0000000..b1b0210 --- /dev/null +++ b/fish/.config/fish/functions/_tide_sub_configure.fish @@ -0,0 +1,92 @@ +set -g _tide_color_dark_blue 0087AF +set -g _tide_color_dark_green 5FAF00 +set -g _tide_color_gold D7AF00 +set -g _tide_color_green 5FD700 +set -g _tide_color_light_blue 00AFFF + +# Create an empty fake function for each item +for func in _fake(functions --all | string match --entire _tide_item) + function $func + end +end + +for file in (status dirname)/tide/configure/{choices, functions}/**.fish + source $file +end + +function _tide_sub_configure + if test $COLUMNS -lt 55 -o $LINES -lt 21 + printf '%s\n' 'Terminal size too small; must be at least 55 x 21' + return 1 + end + + set -g fake_columns $COLUMNS + test $fake_columns -gt 90 && set fake_columns 90 + set -g fake_lines $LINES + + set -g _tide_selected_option + _next_choice all/style +end + +function _next_choice -a nextChoice + set -q _tide_selected_option || return 0 + set -l cmd (string split '/' $nextChoice)[2] + $cmd +end + +function _tide_title -a text + clear + set_color -o + string pad --width (math --scale=0 "$fake_columns/2" + (string length $text)/2) $text + set_color normal +end + +function _tide_option -a symbol text + set -ga _tide_option_list $symbol + + set_color -o + printf '%s\n' "($symbol) $text" + set_color normal +end + +function _tide_menu + set -l list_with_slashes (string join '/' $_tide_option_list) + + printf '%s\n' \ + '(r) Restart from the beginning' \ + '(q) Quit and do nothing'\n + + while true + set_color -o + read --nchars 1 --prompt-str "Choice [$list_with_slashes/r/q] " input + set_color normal + + switch $input + case r + set -e _tide_option_list + _next_choice all/style + break + case q + set -e _tide_selected_option # Skip through all the _next_choices + set -e _tide_option_list + clear + break + case $_tide_option_list + set -e _tide_option_list + set -g _tide_selected_option $input + break + end + end +end + +function _tide_display_prompt -a var_name var_value + test -n "$var_name" && set -g $var_name $var_value + _fake_tide_prompt + printf '\n\n' +end + +function _set_all_items_bg_color -a color + for var in (set --names | string match --regex "fake_.*_bg_color.*" | string match --invert --entire character) + set $var $color + end +end diff --git a/fish/.config/fish/functions/fish_mode_prompt.fish b/fish/.config/fish/functions/fish_mode_prompt.fish new file mode 100644 index 0000000..f37cf7d --- /dev/null +++ b/fish/.config/fish/functions/fish_mode_prompt.fish @@ -0,0 +1 @@ +# Disable default vi prompt diff --git a/fish/.config/fish/functions/fisher.fish b/fish/.config/fish/functions/fisher.fish new file mode 100644 index 0000000..a1fb6cf --- /dev/null +++ b/fish/.config/fish/functions/fisher.fish @@ -0,0 +1,209 @@ +function fisher --argument-names cmd --description "A plugin manager for Fish" + set --query fisher_path || set --local fisher_path $__fish_config_dir + set --local fisher_version 4.3.0 + set --local fish_plugins $__fish_config_dir/fish_plugins + + switch "$cmd" + case -v --version + echo "fisher, version $fisher_version" + case "" -h --help + echo "Usage: fisher install Install plugins" + echo " fisher remove Remove installed plugins" + echo " fisher update Update installed plugins" + echo " fisher update Update all installed plugins" + echo " fisher list [] List installed plugins matching regex" + echo "Options:" + echo " -v or --version Print version" + echo " -h or --help Print this help message" + case ls list + string match --entire --regex -- "$argv[2]" $_fisher_plugins + case install update remove + isatty || read --local --null --array stdin && set --append argv $stdin + + set --local install_plugins + set --local update_plugins + set --local remove_plugins + set --local arg_plugins $argv[2..-1] + set --local old_plugins $_fisher_plugins + set --local new_plugins + + if ! set --query argv[2] + if test "$cmd" != update + echo "fisher: Not enough arguments for command: \"$cmd\"" >&2 && return 1 + else if test ! -e $fish_plugins + echo "fisher: \"$fish_plugins\" file not found: \"$cmd\"" >&2 && return 1 + end + set arg_plugins (string match --regex -- '^[^\s]+$' <$fish_plugins) + end + + for plugin in $arg_plugins + test -e "$plugin" && set plugin (realpath $plugin) + contains -- "$plugin" $new_plugins || set --append new_plugins $plugin + end + + if set --query argv[2] + for plugin in $new_plugins + if contains -- "$plugin" $old_plugins + test "$cmd" = remove && + set --append remove_plugins $plugin || + set --append update_plugins $plugin + else if test "$cmd" = install + set --append install_plugins $plugin + else + echo "fisher: Plugin not installed: \"$plugin\"" >&2 && return 1 + end + end + else + for plugin in $new_plugins + contains -- "$plugin" $old_plugins && + set --append update_plugins $plugin || + set --append install_plugins $plugin + end + + for plugin in $old_plugins + contains -- "$plugin" $new_plugins || set --append remove_plugins $plugin + end + end + + set --local pid_list + set --local source_plugins + set --local fetch_plugins $update_plugins $install_plugins + echo (set_color --bold)fisher $cmd version $fisher_version(set_color normal) + + for plugin in $fetch_plugins + set --local source (command mktemp -d) + set --append source_plugins $source + + command mkdir -p $source/{completions,conf.d,functions} + + fish --command " + if test -e $plugin + command cp -Rf $plugin/* $source + else + set temp (command mktemp -d) + set name (string split \@ $plugin) || set name[2] HEAD + set url https://codeload.github.com/\$name[1]/tar.gz/\$name[2] + + echo Fetching (set_color --underline)\$url(set_color normal) + + if curl --silent \$url | tar -xzC \$temp -f - 2>/dev/null + command cp -Rf \$temp/*/* $source + else + echo fisher: Invalid plugin name or host unavailable: \\\"$plugin\\\" >&2 + command rm -rf $source + end + command rm -rf \$temp + end + + set files $source/* && string match --quiet --regex -- .+\.fish\\\$ \$files + " & + + set --append pid_list (jobs --last --pid) + end + + wait $pid_list 2>/dev/null + + for plugin in $fetch_plugins + if set --local source $source_plugins[(contains --index -- "$plugin" $fetch_plugins)] && test ! -e $source + if set --local index (contains --index -- "$plugin" $install_plugins) + set --erase install_plugins[$index] + else + set --erase update_plugins[(contains --index -- "$plugin" $update_plugins)] + end + end + end + + for plugin in $update_plugins $remove_plugins + if set --local index (contains --index -- "$plugin" $_fisher_plugins) + set --local plugin_files_var _fisher_(string escape --style=var -- $plugin)_files + + if contains -- "$plugin" $remove_plugins + for name in (string replace --filter --regex -- '.+/conf\.d/([^/]+)\.fish$' '$1' $$plugin_files_var) + emit {$name}_uninstall + end + printf "%s\n" Removing\ (set_color red --bold)$plugin(set_color normal) " "$$plugin_files_var + end + + command rm -rf $$plugin_files_var + functions --erase (string replace --filter --regex -- '.+/functions/([^/]+)\.fish$' '$1' $$plugin_files_var) + + for name in (string replace --filter --regex -- '.+/completions/([^/]+)\.fish$' '$1' $$plugin_files_var) + complete --erase --command $name + end + + set --erase _fisher_plugins[$index] + set --erase $plugin_files_var + end + end + + if set --query update_plugins[1] || set --query install_plugins[1] + command mkdir -p $fisher_path/{functions,conf.d,completions} + end + + for plugin in $update_plugins $install_plugins + set --local source $source_plugins[(contains --index -- "$plugin" $fetch_plugins)] + set --local files $source/{functions,conf.d,completions}/* + + if set --local index (contains --index -- $plugin $install_plugins) + set --local user_files $fisher_path/{functions,conf.d,completions}/* + set --local conflict_files + + for file in (string replace -- $source/ $fisher_path/ $files) + contains -- $file $user_files && set --append conflict_files $file + end + + if set --query conflict_files[1] && set --erase install_plugins[$index] + echo -s "fisher: Cannot install \"$plugin\": please remove or move conflicting files first:" \n" "$conflict_files >&2 + continue + end + end + + for file in (string replace -- $source/ "" $files) + command cp -Rf $source/$file $fisher_path/$file + end + + set --local plugin_files_var _fisher_(string escape --style=var -- $plugin)_files + set --query files[1] && set --universal $plugin_files_var (string replace -- $source $fisher_path $files) + + contains -- $plugin $_fisher_plugins || set --universal --append _fisher_plugins $plugin + contains -- $plugin $install_plugins && set --local event install || set --local event update + + printf "%s\n" Installing\ (set_color --bold)$plugin(set_color normal) " "$$plugin_files_var + + for file in (string match --regex -- '.+/[^/]+\.fish$' $$plugin_files_var) + source $file + if set --local name (string replace --regex -- '.+conf\.d/([^/]+)\.fish$' '$1' $file) + emit {$name}_$event + end + end + end + + command rm -rf $source_plugins + + set --query _fisher_plugins[1] || set --erase _fisher_plugins + set --query _fisher_plugins && + printf "%s\n" $_fisher_plugins >$fish_plugins || + command rm -f $fish_plugins + + set --local total (count $install_plugins) (count $update_plugins) (count $remove_plugins) + test "$total" != "0 0 0" && echo (string join ", " ( + test $total[1] = 0 || echo "Installed $total[1]") ( + test $total[2] = 0 || echo "Updated $total[2]") ( + test $total[3] = 0 || echo "Removed $total[3]") + ) plugin/s + case \* + echo "fisher: Unknown command: \"$cmd\"" >&2 && return 1 + end +end + +## Migrations ## +function _fisher_fish_postexec --on-event fish_postexec + if functions --query _fisher_list + fisher update >/dev/null 2>/dev/null + set --query XDG_DATA_HOME || set --local XDG_DATA_HOME ~/.local/share + test -e $XDG_DATA_HOME/fisher && command rm -rf $XDG_DATA_HOME/fisher + functions --erase _fisher_list _fisher_plugin_parse + set --erase fisher_data + end + functions --erase _fisher_fish_postexec +end diff --git a/fish/.config/fish/functions/tide.fish b/fish/.config/fish/functions/tide.fish new file mode 100644 index 0000000..fd278cc --- /dev/null +++ b/fish/.config/fish/functions/tide.fish @@ -0,0 +1,27 @@ +function tide + argparse --stop-nonopt v/version h/help -- $argv + + if set -q _flag_version + printf '%s\n' "tide, version 5.0.1" + else if set -q _flag_help + _tide_help + else if functions --query _tide_sub_$argv[1] + _tide_sub_$argv[1] $argv[2..-1] + else + _tide_help + return 1 + end +end + +function _tide_help + printf '%s\n' \ + 'Usage: tide [options] subcommand [options]' \ + '' \ + 'Options:' \ + ' -v or --version print tide version number' \ + ' -h or --help print this help message' \ + '' \ + 'Subcommands:' \ + ' configure run interactive configuration wizard' \ + ' bug-report print info for use in bug reports' +end diff --git a/fish/.config/fish/functions/tide/configure/choices/all/finish.fish b/fish/.config/fish/functions/tide/configure/choices/all/finish.fish new file mode 100644 index 0000000..66cab66 --- /dev/null +++ b/fish/.config/fish/functions/tide/configure/choices/all/finish.fish @@ -0,0 +1,43 @@ +function finish + set_color red + _tide_title 'Overwrite tide config?' + set_color normal + + _tide_option y Yes + printf '%b' '\n' + + _tide_menu + switch $_tide_selected_option + case y + _tide_finish + clear + end +end + +function _tide_finish + set -e _tide_selected_option # Skip through all the _next_choices + + # Deal with prompt char/vi mode + if contains character $fake_tide_left_prompt_items + _tide_find_and_remove vi_mode fake_tide_right_prompt_items + else + # If no character, insert vi_mode + _tide_find_and_remove vi_mode fake_tide_right_prompt_items + if contains time $fake_tide_right_prompt_items + set fake_tide_right_prompt_items $fake_tide_right_prompt_items[1..-2] vi_mode $fake_tide_right_prompt_items[-1] + else + set -a fake_tide_right_prompt_items vi_mode + end + end + + # Set the real variables + for fakeVar in (set --names | string match --regex "^fake_tide.*") + set -U (string replace 'fake_' '' $fakeVar) $$fakeVar + end + + # Make sure old prompt won't display + set -e $_tide_prompt_var 2>/dev/null + + # Re-initialize the prompt + source (functions --details fish_prompt) +end diff --git a/fish/.config/fish/functions/tide/configure/choices/all/icons.fish b/fish/.config/fish/functions/tide/configure/choices/all/icons.fish new file mode 100644 index 0000000..e53bffa --- /dev/null +++ b/fish/.config/fish/functions/tide/configure/choices/all/icons.fish @@ -0,0 +1,33 @@ +function icons + _tide_title Icons + + _tide_option 1 'Few icons' + _tide_display_prompt + + _tide_option 2 'Many icons' + _enable_icons + _tide_display_prompt + + _tide_menu + switch $_tide_selected_option + case 1 + _disable_icons + end + _next_choice all/finish +end + +function _enable_icons + set -p fake_tide_left_prompt_items os + set -g fake_tide_pwd_icon  + set -g fake_tide_pwd_icon_home  + set -g fake_tide_cmd_duration_icon  + set -g fake_tide_git_icon  +end + +function _disable_icons + _tide_find_and_remove os fake_tide_left_prompt_items + set fake_tide_pwd_icon + set fake_tide_pwd_icon_home + set fake_tide_cmd_duration_icon + set fake_tide_git_icon +end diff --git a/fish/.config/fish/functions/tide/configure/choices/all/prompt_colors.fish b/fish/.config/fish/functions/tide/configure/choices/all/prompt_colors.fish new file mode 100644 index 0000000..90b1a9d --- /dev/null +++ b/fish/.config/fish/functions/tide/configure/choices/all/prompt_colors.fish @@ -0,0 +1,26 @@ +function prompt_colors + _tide_title 'Prompt Colors' + + _tide_option 1 'True color' + _tide_display_prompt + + _tide_option 2 '16 colors' + _load_config "$_tide_configure_style"_16color + set -g _tide_16color true + _tide_display_prompt + + _tide_menu + switch $_tide_selected_option + case 1 + _load_config "$_tide_configure_style" + set -e _tide_16color + switch $_tide_configure_style + case lean rainbow + _next_choice all/show_time + case classic + _next_choice classic/classic_prompt_color + end + case 2 + _next_choice all/show_time + end +end diff --git a/fish/.config/fish/functions/tide/configure/choices/all/prompt_connection.fish b/fish/.config/fish/functions/tide/configure/choices/all/prompt_connection.fish new file mode 100644 index 0000000..ae31ef3 --- /dev/null +++ b/fish/.config/fish/functions/tide/configure/choices/all/prompt_connection.fish @@ -0,0 +1,28 @@ +function prompt_connection + _tide_title 'Prompt Connection' + + _tide_option 1 Disconnected + _tide_display_prompt fake_tide_prompt_icon_connection ' ' + + _tide_option 2 Dotted + _tide_display_prompt fake_tide_prompt_icon_connection '·' + + _tide_option 3 Solid + _tide_display_prompt fake_tide_prompt_icon_connection '─' + + _tide_menu + switch $_tide_selected_option + case 1 + set -g fake_tide_prompt_icon_connection ' ' + case 2 + set -g fake_tide_prompt_icon_connection '·' + case 3 + set -g fake_tide_prompt_icon_connection '─' + end + switch $_tide_configure_style + case lean + _next_choice all/prompt_connection_andor_frame_color + case classic rainbow + _next_choice powerline/powerline_prompt_frame + end +end diff --git a/fish/.config/fish/functions/tide/configure/choices/all/prompt_connection_andor_frame_color.fish b/fish/.config/fish/functions/tide/configure/choices/all/prompt_connection_andor_frame_color.fish new file mode 100644 index 0000000..b8803b4 --- /dev/null +++ b/fish/.config/fish/functions/tide/configure/choices/all/prompt_connection_andor_frame_color.fish @@ -0,0 +1,36 @@ +function prompt_connection_andor_frame_color + if test "$_tide_16color" = true || + test "$fake_tide_left_prompt_frame_enabled" = false -a \ + "$fake_tide_right_prompt_frame_enabled" = false -a \ + "$fake_tide_prompt_icon_connection" = ' ' + _next_choice all/prompt_spacing + return 0 + end + + _tide_title "Connection & Frame Color" + + _tide_option 1 Lightest + _tide_display_prompt fake_tide_prompt_color_frame_and_connection 808080 + + _tide_option 2 Light + _tide_display_prompt fake_tide_prompt_color_frame_and_connection 6C6C6C + + _tide_option 3 Dark + _tide_display_prompt fake_tide_prompt_color_frame_and_connection 585858 + + _tide_option 4 Darkest + _tide_display_prompt fake_tide_prompt_color_frame_and_connection 444444 + + _tide_menu + switch $_tide_selected_option + case 1 + set -g fake_tide_prompt_color_frame_and_connection 808080 + case 2 + set -g fake_tide_prompt_color_frame_and_connection 6C6C6C + case 3 + set -g fake_tide_prompt_color_frame_and_connection 585858 + case 4 + set -g fake_tide_prompt_color_frame_and_connection 444444 + end + _next_choice all/prompt_spacing +end diff --git a/fish/.config/fish/functions/tide/configure/choices/all/prompt_spacing.fish b/fish/.config/fish/functions/tide/configure/choices/all/prompt_spacing.fish new file mode 100644 index 0000000..a5bb98b --- /dev/null +++ b/fish/.config/fish/functions/tide/configure/choices/all/prompt_spacing.fish @@ -0,0 +1,21 @@ +function prompt_spacing + _tide_title 'Prompt Spacing' + + _tide_option 1 Compact + _tide_display_prompt + printf \e\[1A # Move cursor up 1 row + _tide_display_prompt + + _tide_option 2 Sparse + _tide_display_prompt + _tide_display_prompt + + _tide_menu + switch $_tide_selected_option + case 1 + set -g fake_tide_prompt_add_newline_before false + case 2 + set -g fake_tide_prompt_add_newline_before true + end + _next_choice all/icons +end diff --git a/fish/.config/fish/functions/tide/configure/choices/all/show_time.fish b/fish/.config/fish/functions/tide/configure/choices/all/show_time.fish new file mode 100644 index 0000000..37c2e3d --- /dev/null +++ b/fish/.config/fish/functions/tide/configure/choices/all/show_time.fish @@ -0,0 +1,31 @@ +function show_time + _tide_title 'Show current time?' + + _tide_option 1 No + _tide_display_prompt + + set -a fake_tide_right_prompt_items time + + _tide_option 2 '24-hour format' + _tide_display_prompt fake_tide_time_format '%T' + + _tide_option 3 '12-hour format' + _tide_display_prompt fake_tide_time_format '%r' + + _tide_menu + switch $_tide_selected_option + case 1 + set -g fake_tide_time_format '' + set -e fake_tide_right_prompt_items[-1] + case 2 + set -g fake_tide_time_format '%T' + case 3 + set -g fake_tide_time_format '%r' + end + switch $_tide_configure_style + case lean + _next_choice "$_tide_configure_style"/"$_tide_configure_style"_prompt_height + case classic rainbow + _next_choice "$_tide_configure_style"/"$_tide_configure_style"_prompt_separators + end +end diff --git a/fish/.config/fish/functions/tide/configure/choices/all/style.fish b/fish/.config/fish/functions/tide/configure/choices/all/style.fish new file mode 100644 index 0000000..61542ba --- /dev/null +++ b/fish/.config/fish/functions/tide/configure/choices/all/style.fish @@ -0,0 +1,33 @@ +function style + _tide_title 'Prompt Style' + + _tide_option 1 Lean + _load_config lean + _tide_display_prompt + + _tide_option 2 Classic + _load_config classic + _tide_display_prompt + + _tide_option 3 Rainbow + _load_config rainbow + _tide_display_prompt + + _tide_menu + switch $_tide_selected_option + case 1 + _load_config lean + set -g _tide_configure_style lean + case 2 + _load_config classic + set -g _tide_configure_style classic + case 3 + _load_config rainbow + set -g _tide_configure_style rainbow + end + _next_choice all/prompt_colors +end + +function _load_config -a name + string replace --regex '^' 'set -g fake_' <(status dirname)/../../configs/$name.fish | source +end diff --git a/fish/.config/fish/functions/tide/configure/choices/classic/classic_prompt_color.fish b/fish/.config/fish/functions/tide/configure/choices/classic/classic_prompt_color.fish new file mode 100644 index 0000000..fa55b3f --- /dev/null +++ b/fish/.config/fish/functions/tide/configure/choices/classic/classic_prompt_color.fish @@ -0,0 +1,32 @@ +function classic_prompt_color + _tide_title 'Prompt Color' + + _tide_option 1 Lightest + _set_all_items_bg_color 585858 + _tide_display_prompt + + _tide_option 2 Light + _set_all_items_bg_color 444444 + _tide_display_prompt + + _tide_option 3 Dark + _set_all_items_bg_color 303030 + _tide_display_prompt + + _tide_option 4 Darkest + _set_all_items_bg_color 1C1C1C + _tide_display_prompt + + _tide_menu + switch $_tide_selected_option + case 1 + _set_all_items_bg_color 585858 + case 2 + _set_all_items_bg_color 444444 + case 3 + _set_all_items_bg_color 303030 + case 4 + _set_all_items_bg_color 1C1C1C + end + _next_choice all/show_time +end diff --git a/fish/.config/fish/functions/tide/configure/choices/classic/classic_prompt_separators.fish b/fish/.config/fish/functions/tide/configure/choices/classic/classic_prompt_separators.fish new file mode 100644 index 0000000..c3bf94b --- /dev/null +++ b/fish/.config/fish/functions/tide/configure/choices/classic/classic_prompt_separators.fish @@ -0,0 +1,40 @@ +function classic_prompt_separators + _tide_title 'Prompt Separators' + + _tide_option 1 Angled + set -g fake_tide_left_prompt_separator_same_color '' + set -g fake_tide_right_prompt_separator_same_color '' + _tide_display_prompt + + _tide_option 2 Vertical + set -g fake_tide_left_prompt_separator_same_color '│' + set -g fake_tide_right_prompt_separator_same_color '│' + _tide_display_prompt + + _tide_option 3 Slanted + set -g fake_tide_left_prompt_separator_same_color '╱' + set -g fake_tide_right_prompt_separator_same_color '╱' + _tide_display_prompt + + _tide_option 4 Round + set -g fake_tide_left_prompt_separator_same_color '' + set -g fake_tide_right_prompt_separator_same_color '' + _tide_display_prompt + + _tide_menu + switch $_tide_selected_option + case 1 + set -g fake_tide_left_prompt_separator_same_color '' + set -g fake_tide_right_prompt_separator_same_color '' + case 2 + set -g fake_tide_left_prompt_separator_same_color '│' + set -g fake_tide_right_prompt_separator_same_color '│' + case 3 + set -g fake_tide_left_prompt_separator_same_color '╱' + set -g fake_tide_right_prompt_separator_same_color '╱' + case 4 + set -g fake_tide_left_prompt_separator_same_color '' + set -g fake_tide_right_prompt_separator_same_color '' + end + _next_choice powerline/powerline_prompt_heads +end diff --git a/fish/.config/fish/functions/tide/configure/choices/lean/lean_prompt_height.fish b/fish/.config/fish/functions/tide/configure/choices/lean/lean_prompt_height.fish new file mode 100644 index 0000000..b8aebfc --- /dev/null +++ b/fish/.config/fish/functions/tide/configure/choices/lean/lean_prompt_height.fish @@ -0,0 +1,22 @@ +function lean_prompt_height + _tide_title 'Prompt Height' + + _tide_option 1 'One line' + _tide_find_and_remove newline fake_tide_left_prompt_items + _tide_display_prompt + + _tide_option 2 'Two lines' + set -g fake_tide_left_prompt_items $fake_tide_left_prompt_items[1..-2] newline $fake_tide_left_prompt_items[-1] + _tide_display_prompt + + _tide_menu + switch $_tide_selected_option + case 1 + _tide_find_and_remove newline fake_tide_left_prompt_items + _next_choice all/prompt_connection_andor_frame_color + case 2 + _tide_find_and_remove newline fake_tide_left_prompt_items + set -g fake_tide_left_prompt_items $fake_tide_left_prompt_items[1..-2] newline $fake_tide_left_prompt_items[-1] + _next_choice all/prompt_connection + end +end diff --git a/fish/.config/fish/functions/tide/configure/choices/powerline/powerline_prompt_frame.fish b/fish/.config/fish/functions/tide/configure/choices/powerline/powerline_prompt_frame.fish new file mode 100644 index 0000000..19b3588 --- /dev/null +++ b/fish/.config/fish/functions/tide/configure/choices/powerline/powerline_prompt_frame.fish @@ -0,0 +1,46 @@ +function powerline_prompt_frame + _tide_title 'Prompt Frame' + + _tide_option 1 'No frame' + set fake_tide_left_prompt_frame_enabled false + set fake_tide_right_prompt_frame_enabled false + set -a fake_tide_left_prompt_items character + _tide_display_prompt + set -e fake_tide_left_prompt_items[-1] + + _tide_option 2 Left + set fake_tide_left_prompt_frame_enabled true + set fake_tide_right_prompt_frame_enabled false + _tide_display_prompt + + _tide_option 3 Right + set fake_tide_left_prompt_frame_enabled false + set fake_tide_right_prompt_frame_enabled true + set -a fake_tide_left_prompt_items character + _tide_display_prompt + set -e fake_tide_left_prompt_items[-1] + + _tide_option 4 Full + set fake_tide_left_prompt_frame_enabled true + set fake_tide_right_prompt_frame_enabled true + _tide_display_prompt + + _tide_menu + switch $_tide_selected_option + case 1 + set fake_tide_left_prompt_frame_enabled false + set fake_tide_right_prompt_frame_enabled false + set -a fake_tide_left_prompt_items character + case 2 + set fake_tide_left_prompt_frame_enabled true + set fake_tide_right_prompt_frame_enabled false + case 3 + set fake_tide_left_prompt_frame_enabled false + set fake_tide_right_prompt_frame_enabled true + set -a fake_tide_left_prompt_items character + case 4 + set fake_tide_left_prompt_frame_enabled true + set fake_tide_right_prompt_frame_enabled true + end + _next_choice all/prompt_connection_andor_frame_color +end diff --git a/fish/.config/fish/functions/tide/configure/choices/powerline/powerline_prompt_heads.fish b/fish/.config/fish/functions/tide/configure/choices/powerline/powerline_prompt_heads.fish new file mode 100644 index 0000000..005ac20 --- /dev/null +++ b/fish/.config/fish/functions/tide/configure/choices/powerline/powerline_prompt_heads.fish @@ -0,0 +1,40 @@ +function powerline_prompt_heads + _tide_title 'Prompt Heads' + + _tide_option 1 Sharp + set -g fake_tide_left_prompt_suffix '' + set -g fake_tide_right_prompt_prefix '' + _tide_display_prompt + + _tide_option 2 Blurred + set -g fake_tide_left_prompt_suffix '▓▒░' + set -g fake_tide_right_prompt_prefix '░▒▓' + _tide_display_prompt + + _tide_option 3 Slanted + set -g fake_tide_left_prompt_suffix '' + set -g fake_tide_right_prompt_prefix '' + _tide_display_prompt + + _tide_option 4 Round + set -g fake_tide_left_prompt_suffix '' + set -g fake_tide_right_prompt_prefix '' + _tide_display_prompt + + _tide_menu + switch $_tide_selected_option + case 1 + set -g fake_tide_left_prompt_suffix '' + set -g fake_tide_right_prompt_prefix '' + case 2 + set -g fake_tide_left_prompt_suffix '▓▒░' + set -g fake_tide_right_prompt_prefix '░▒▓' + case 3 + set -g fake_tide_left_prompt_suffix '' + set -g fake_tide_right_prompt_prefix '' + case 4 + set -g fake_tide_left_prompt_suffix '' + set -g fake_tide_right_prompt_prefix '' + end + _next_choice powerline/powerline_prompt_tails +end diff --git a/fish/.config/fish/functions/tide/configure/choices/powerline/powerline_prompt_height.fish b/fish/.config/fish/functions/tide/configure/choices/powerline/powerline_prompt_height.fish new file mode 100644 index 0000000..83fef05 --- /dev/null +++ b/fish/.config/fish/functions/tide/configure/choices/powerline/powerline_prompt_height.fish @@ -0,0 +1,30 @@ +function powerline_prompt_height + _tide_title 'Prompt Height' + + _tide_option 1 'One line' + _tide_find_and_remove newline fake_tide_left_prompt_items + set fake_tide_left_prompt_frame_enabled false + set fake_tide_right_prompt_frame_enabled false + _tide_display_prompt + + _tide_option 2 'Two lines' + set -g fake_tide_left_prompt_items $fake_tide_left_prompt_items newline + set fake_tide_left_prompt_frame_enabled true + set fake_tide_right_prompt_frame_enabled true + _tide_display_prompt + + _tide_menu + switch $_tide_selected_option + case 1 + _tide_find_and_remove newline fake_tide_left_prompt_items + set fake_tide_left_prompt_frame_enabled false + set fake_tide_right_prompt_frame_enabled false + _next_choice all/prompt_connection_andor_frame_color + case 2 + _tide_find_and_remove newline fake_tide_left_prompt_items + set -g fake_tide_left_prompt_items $fake_tide_left_prompt_items newline + set fake_tide_left_prompt_frame_enabled true + set fake_tide_right_prompt_frame_enabled true + _next_choice all/prompt_connection + end +end diff --git a/fish/.config/fish/functions/tide/configure/choices/powerline/powerline_prompt_tails.fish b/fish/.config/fish/functions/tide/configure/choices/powerline/powerline_prompt_tails.fish new file mode 100644 index 0000000..dcd03ec --- /dev/null +++ b/fish/.config/fish/functions/tide/configure/choices/powerline/powerline_prompt_tails.fish @@ -0,0 +1,48 @@ +function powerline_prompt_tails + _tide_title 'Prompt Tails' + + _tide_option 1 Flat + set -g fake_tide_left_prompt_prefix '' + set -g fake_tide_right_prompt_suffix '' + _tide_display_prompt + + _tide_option 2 Blurred + set -g fake_tide_left_prompt_prefix '░▒▓' + set -g fake_tide_right_prompt_suffix '▓▒░' + _tide_display_prompt + + _tide_option 3 Sharp + set -g fake_tide_left_prompt_prefix '' + set -g fake_tide_right_prompt_suffix '' + _tide_display_prompt + + _tide_option 4 Slanted + set -g fake_tide_left_prompt_prefix '' + set -g fake_tide_right_prompt_suffix '' + _tide_display_prompt + + _tide_option 5 Round + set -g fake_tide_left_prompt_prefix '' + set -g fake_tide_right_prompt_suffix '' + _tide_display_prompt + + _tide_menu + switch $_tide_selected_option + case 1 + set -g fake_tide_left_prompt_prefix '' + set -g fake_tide_right_prompt_suffix '' + case 2 + set -g fake_tide_left_prompt_prefix '░▒▓' + set -g fake_tide_right_prompt_suffix '▓▒░' + case 3 + set -g fake_tide_left_prompt_prefix '' + set -g fake_tide_right_prompt_suffix '' + case 4 + set -g fake_tide_left_prompt_prefix '' + set -g fake_tide_right_prompt_suffix '' + case 5 + set -g fake_tide_left_prompt_prefix '' + set -g fake_tide_right_prompt_suffix '' + end + _next_choice powerline/powerline_prompt_height +end diff --git a/fish/.config/fish/functions/tide/configure/choices/rainbow/rainbow_prompt_separators.fish b/fish/.config/fish/functions/tide/configure/choices/rainbow/rainbow_prompt_separators.fish new file mode 100644 index 0000000..cdbf850 --- /dev/null +++ b/fish/.config/fish/functions/tide/configure/choices/rainbow/rainbow_prompt_separators.fish @@ -0,0 +1,40 @@ +function rainbow_prompt_separators + _tide_title 'Prompt Separators' + + _tide_option 1 Angled + set -g fake_tide_left_prompt_separator_diff_color '' + set -g fake_tide_right_prompt_separator_diff_color '' + _tide_display_prompt + + _tide_option 2 Vertical + set -g fake_tide_left_prompt_separator_diff_color '' + set -g fake_tide_right_prompt_separator_diff_color '' + _tide_display_prompt + + _tide_option 3 Slanted + set -g fake_tide_left_prompt_separator_diff_color '' + set -g fake_tide_right_prompt_separator_diff_color '' + _tide_display_prompt + + _tide_option 4 Round + set -g fake_tide_left_prompt_separator_diff_color '' + set -g fake_tide_right_prompt_separator_diff_color '' + _tide_display_prompt + + _tide_menu + switch $_tide_selected_option + case 1 + set -g fake_tide_left_prompt_separator_diff_color '' + set -g fake_tide_right_prompt_separator_diff_color '' + case 2 + set -g fake_tide_left_prompt_separator_diff_color '' + set -g fake_tide_right_prompt_separator_diff_color '' + case 3 + set -g fake_tide_left_prompt_separator_diff_color '' + set -g fake_tide_right_prompt_separator_diff_color '' + case 4 + set -g fake_tide_left_prompt_separator_diff_color '' + set -g fake_tide_right_prompt_separator_diff_color '' + end + _next_choice powerline/powerline_prompt_heads +end diff --git a/fish/.config/fish/functions/tide/configure/configs/classic.fish b/fish/.config/fish/functions/tide/configure/configs/classic.fish new file mode 100644 index 0000000..fcbe1c4 --- /dev/null +++ b/fish/.config/fish/functions/tide/configure/configs/classic.fish @@ -0,0 +1,105 @@ +tide_character_color $_tide_color_green +tide_character_color_failure FF0000 +tide_character_icon '❯' +tide_character_vi_icon_default '❮' +tide_character_vi_icon_replace '▶' +tide_character_vi_icon_visual V +tide_chruby_bg_color 444444 +tide_chruby_color B31209 +tide_chruby_icon '' +tide_cmd_duration_bg_color 444444 +tide_cmd_duration_color 87875F +tide_cmd_duration_decimals 0 +tide_cmd_duration_icon +tide_cmd_duration_threshold 3000 +tide_context_always_display false +tide_context_bg_color 444444 +tide_context_color_default D7AF87 +tide_context_color_root $_tide_color_gold +tide_context_color_ssh D7AF87 +tide_git_bg_color 444444 +tide_git_bg_color_unstable 444444 +tide_git_bg_color_urgent 444444 +tide_git_color_branch $_tide_color_green +tide_git_color_conflicted FF0000 +tide_git_color_dirty $_tide_color_gold +tide_git_color_operation FF0000 +tide_git_color_staged $_tide_color_gold +tide_git_color_stash $_tide_color_green +tide_git_color_untracked $_tide_color_light_blue +tide_git_color_upstream $_tide_color_green +tide_git_icon +tide_go_bg_color 444444 +tide_go_color 00ACD7 +tide_go_icon  +tide_jobs_bg_color 444444 +tide_jobs_color $_tide_color_dark_green +tide_jobs_icon '' +tide_kubectl_bg_color 444444 +tide_kubectl_color 326CE5 +tide_kubectl_icon '⎈' +tide_left_prompt_frame_enabled true +tide_left_prompt_items pwd git newline +tide_left_prompt_prefix '' +tide_left_prompt_separator_diff_color '' +tide_left_prompt_separator_same_color '' +tide_left_prompt_suffix '' +tide_node_bg_color 444444 +tide_node_color 44883E +tide_node_icon '⬢' +tide_os_bg_color 444444 +tide_os_color EEEEEE +tide_php_bg_color 444444 +tide_php_color 617CBE +tide_php_icon '' +tide_prompt_add_newline_before true +tide_prompt_color_frame_and_connection 6C6C6C +tide_prompt_color_separator_same_color 949494 +tide_prompt_icon_connection ' ' +tide_prompt_min_cols 26 +tide_prompt_pad_items true +tide_pwd_bg_color 444444 +tide_pwd_color_anchors $_tide_color_light_blue +tide_pwd_color_dirs $_tide_color_dark_blue +tide_pwd_color_truncated_dirs 8787AF +tide_pwd_icon +tide_pwd_icon_home +tide_pwd_icon_unwritable '' +tide_pwd_markers .bzr .citc .git .hg .node-version .python-version .ruby-version .shorten_folder_marker .svn .terraform Cargo.toml composer.json CVS go.mod package.json +tide_right_prompt_frame_enabled true +tide_right_prompt_items status cmd_duration context jobs node virtual_env rustc php chruby go kubectl terraform vi_mode +tide_right_prompt_prefix '' +tide_right_prompt_separator_diff_color '' +tide_right_prompt_separator_same_color '' +tide_right_prompt_suffix '' +tide_rustc_bg_color 444444 +tide_rustc_color F74C00 +tide_rustc_icon '' +tide_shlvl_bg_color 444444 +tide_shlvl_color d78700 +tide_shlvl_icon '' +tide_shlvl_threshold 1 +tide_status_bg_color 444444 +tide_status_bg_color_failure 444444 +tide_status_color $_tide_color_dark_green +tide_status_color_failure D70000 +tide_status_icon '✔' +tide_status_icon_failure '✘' +tide_terraform_bg_color 444444 +tide_terraform_color 844FBA +tide_terraform_icon +tide_time_bg_color 444444 +tide_time_color 5F8787 +tide_time_format '%T' +tide_vi_mode_bg_color_default 444444 +tide_vi_mode_bg_color_replace 444444 +tide_vi_mode_bg_color_visual 444444 +tide_vi_mode_color_default 87af00 +tide_vi_mode_color_replace d78700 +tide_vi_mode_color_visual 5f87d7 +tide_vi_mode_icon_default DEFAULT +tide_vi_mode_icon_replace REPLACE +tide_vi_mode_icon_visual VISUAL +tide_virtual_env_bg_color 444444 +tide_virtual_env_color 00AFAF +tide_virtual_env_icon '' diff --git a/fish/.config/fish/functions/tide/configure/configs/classic_16color.fish b/fish/.config/fish/functions/tide/configure/configs/classic_16color.fish new file mode 100644 index 0000000..d3a505f --- /dev/null +++ b/fish/.config/fish/functions/tide/configure/configs/classic_16color.fish @@ -0,0 +1,59 @@ +tide_character_color brgreen +tide_character_color_failure brred +tide_chruby_bg_color black +tide_chruby_color red +tide_cmd_duration_bg_color black +tide_cmd_duration_color brblack +tide_context_bg_color black +tide_context_color_default yellow +tide_context_color_root bryellow +tide_context_color_ssh yellow +tide_git_bg_color black +tide_git_bg_color_unstable black +tide_git_bg_color_urgent black +tide_git_color_branch brgreen +tide_git_color_conflicted brred +tide_git_color_dirty bryellow +tide_git_color_operation brred +tide_git_color_staged bryellow +tide_git_color_stash brgreen +tide_git_color_untracked brblue +tide_git_color_upstream brgreen +tide_go_bg_color black +tide_go_color brcyan +tide_jobs_bg_color black +tide_jobs_color green +tide_kubectl_bg_color black +tide_kubectl_color blue +tide_node_bg_color black +tide_node_color green +tide_os_bg_color black +tide_os_color brwhite +tide_php_bg_color black +tide_php_color blue +tide_prompt_color_frame_and_connection brblack +tide_prompt_color_separator_same_color brblack +tide_pwd_bg_color black +tide_pwd_color_anchors brcyan +tide_pwd_color_dirs cyan +tide_pwd_color_truncated_dirs magenta +tide_rustc_bg_color black +tide_rustc_color red +tide_shlvl_bg_color black +tide_shlvl_color yellow +tide_status_bg_color black +tide_status_bg_color_failure black +tide_status_color green +tide_status_color_failure red +tide_terraform_bg_color black +tide_terraform_color magenta +tide_time_bg_color black +tide_time_color brblack +tide_vi_mode_bg_color_default black +tide_vi_mode_bg_color_replace black +tide_vi_mode_bg_color_visual black +tide_vi_mode_color_default green +tide_vi_mode_color_replace yellow +tide_vi_mode_color_visual blue +tide_virtual_env_bg_color black +tide_virtual_env_color cyan diff --git a/fish/.config/fish/functions/tide/configure/configs/lean.fish b/fish/.config/fish/functions/tide/configure/configs/lean.fish new file mode 100644 index 0000000..ba45973 --- /dev/null +++ b/fish/.config/fish/functions/tide/configure/configs/lean.fish @@ -0,0 +1,105 @@ +tide_character_color $_tide_color_green +tide_character_color_failure FF0000 +tide_character_icon '❯' +tide_character_vi_icon_default '❮' +tide_character_vi_icon_replace '▶' +tide_character_vi_icon_visual V +tide_chruby_bg_color normal +tide_chruby_color B31209 +tide_chruby_icon '' +tide_cmd_duration_bg_color normal +tide_cmd_duration_color 87875F +tide_cmd_duration_decimals 0 +tide_cmd_duration_icon +tide_cmd_duration_threshold 3000 +tide_context_always_display false +tide_context_bg_color normal +tide_context_color_default D7AF87 +tide_context_color_root $_tide_color_gold +tide_context_color_ssh D7AF87 +tide_git_bg_color normal +tide_git_bg_color_unstable normal +tide_git_bg_color_urgent normal +tide_git_color_branch $_tide_color_green +tide_git_color_conflicted FF0000 +tide_git_color_dirty $_tide_color_gold +tide_git_color_operation FF0000 +tide_git_color_staged $_tide_color_gold +tide_git_color_stash $_tide_color_green +tide_git_color_untracked $_tide_color_light_blue +tide_git_color_upstream $_tide_color_green +tide_git_icon +tide_go_bg_color normal +tide_go_color 00ACD7 +tide_go_icon  +tide_jobs_bg_color normal +tide_jobs_color $_tide_color_dark_green +tide_jobs_icon '' +tide_kubectl_bg_color normal +tide_kubectl_color 326CE5 +tide_kubectl_icon '⎈' +tide_left_prompt_frame_enabled false +tide_left_prompt_items pwd git newline character +tide_left_prompt_prefix '' +tide_left_prompt_separator_diff_color ' ' +tide_left_prompt_separator_same_color ' ' +tide_left_prompt_suffix ' ' +tide_node_bg_color normal +tide_node_color 44883E +tide_node_icon '⬢' +tide_os_bg_color normal +tide_os_color normal +tide_php_bg_color normal +tide_php_color 617CBE +tide_php_icon '' +tide_prompt_add_newline_before true +tide_prompt_color_frame_and_connection 6C6C6C +tide_prompt_color_separator_same_color 949494 +tide_prompt_icon_connection ' ' +tide_prompt_min_cols 26 +tide_prompt_pad_items false +tide_pwd_bg_color normal +tide_pwd_color_anchors $_tide_color_light_blue +tide_pwd_color_dirs $_tide_color_dark_blue +tide_pwd_color_truncated_dirs 8787AF +tide_pwd_icon +tide_pwd_icon_home +tide_pwd_icon_unwritable '' +tide_pwd_markers .bzr .citc .git .hg .node-version .python-version .ruby-version .shorten_folder_marker .svn .terraform Cargo.toml composer.json CVS go.mod package.json +tide_right_prompt_frame_enabled false +tide_right_prompt_items status cmd_duration context jobs node virtual_env rustc php chruby go kubectl terraform +tide_right_prompt_prefix ' ' +tide_right_prompt_separator_diff_color ' ' +tide_right_prompt_separator_same_color ' ' +tide_right_prompt_suffix '' +tide_rustc_bg_color normal +tide_rustc_color F74C00 +tide_rustc_icon '' +tide_shlvl_bg_color normal +tide_shlvl_color d78700 +tide_shlvl_icon '' +tide_shlvl_threshold 1 +tide_status_bg_color normal +tide_status_bg_color_failure normal +tide_status_color $_tide_color_dark_green +tide_status_color_failure D70000 +tide_status_icon '✔' +tide_status_icon_failure '✘' +tide_terraform_bg_color normal +tide_terraform_color 844FBA +tide_terraform_icon +tide_time_bg_color normal +tide_time_color 5F8787 +tide_time_format '%T' +tide_vi_mode_bg_color_default +tide_vi_mode_bg_color_replace +tide_vi_mode_bg_color_visual +tide_vi_mode_color_default +tide_vi_mode_color_replace +tide_vi_mode_color_visual +tide_vi_mode_icon_default +tide_vi_mode_icon_replace +tide_vi_mode_icon_visual +tide_virtual_env_bg_color normal +tide_virtual_env_color 00AFAF +tide_virtual_env_icon '' diff --git a/fish/.config/fish/functions/tide/configure/configs/lean_16color.fish b/fish/.config/fish/functions/tide/configure/configs/lean_16color.fish new file mode 100644 index 0000000..ead6e6f --- /dev/null +++ b/fish/.config/fish/functions/tide/configure/configs/lean_16color.fish @@ -0,0 +1,59 @@ +tide_character_color brgreen +tide_character_color_failure brred +tide_chruby_bg_color normal +tide_chruby_color red +tide_cmd_duration_bg_color normal +tide_cmd_duration_color brblack +tide_context_bg_color normal +tide_context_color_default yellow +tide_context_color_root bryellow +tide_context_color_ssh yellow +tide_git_bg_color normal +tide_git_bg_color_unstable normal +tide_git_bg_color_urgent normal +tide_git_color_branch brgreen +tide_git_color_conflicted brred +tide_git_color_dirty bryellow +tide_git_color_operation brred +tide_git_color_staged bryellow +tide_git_color_stash brgreen +tide_git_color_untracked brblue +tide_git_color_upstream brgreen +tide_go_bg_color normal +tide_go_color brcyan +tide_jobs_bg_color normal +tide_jobs_color green +tide_kubectl_bg_color normal +tide_kubectl_color blue +tide_node_bg_color normal +tide_node_color green +tide_os_bg_color normal +tide_os_color brwhite +tide_php_bg_color normal +tide_php_color blue +tide_prompt_color_frame_and_connection brblack +tide_prompt_color_separator_same_color brblack +tide_pwd_bg_color normal +tide_pwd_color_anchors brcyan +tide_pwd_color_dirs cyan +tide_pwd_color_truncated_dirs magenta +tide_rustc_bg_color normal +tide_rustc_color red +tide_shlvl_bg_color normal +tide_shlvl_color yellow +tide_status_bg_color normal +tide_status_bg_color_failure normal +tide_status_color green +tide_status_color_failure red +tide_terraform_bg_color normal +tide_terraform_color magenta +tide_time_bg_color normal +tide_time_color brblack +tide_vi_mode_bg_color_default normal +tide_vi_mode_bg_color_replace normal +tide_vi_mode_bg_color_visual normal +tide_vi_mode_color_default green +tide_vi_mode_color_replace yellow +tide_vi_mode_color_visual blue +tide_virtual_env_bg_color normal +tide_virtual_env_color cyan diff --git a/fish/.config/fish/functions/tide/configure/configs/rainbow.fish b/fish/.config/fish/functions/tide/configure/configs/rainbow.fish new file mode 100644 index 0000000..39afcbc --- /dev/null +++ b/fish/.config/fish/functions/tide/configure/configs/rainbow.fish @@ -0,0 +1,105 @@ +tide_character_color $_tide_color_green +tide_character_color_failure FF0000 +tide_character_icon '❯' +tide_character_vi_icon_default '❮' +tide_character_vi_icon_replace '▶' +tide_character_vi_icon_visual V +tide_chruby_bg_color B31209 +tide_chruby_color 000000 +tide_chruby_icon '' +tide_cmd_duration_bg_color C4A000 +tide_cmd_duration_color 000000 +tide_cmd_duration_decimals 0 +tide_cmd_duration_icon +tide_cmd_duration_threshold 3000 +tide_context_always_display false +tide_context_bg_color 444444 +tide_context_color_default D7AF87 +tide_context_color_root $_tide_color_gold +tide_context_color_ssh D7AF87 +tide_git_bg_color 4E9A06 +tide_git_bg_color_unstable C4A000 +tide_git_bg_color_urgent CC0000 +tide_git_color_branch 000000 +tide_git_color_conflicted 000000 +tide_git_color_dirty 000000 +tide_git_color_operation 000000 +tide_git_color_staged 000000 +tide_git_color_stash 000000 +tide_git_color_untracked 000000 +tide_git_color_upstream 000000 +tide_git_icon +tide_go_bg_color 00ACD7 +tide_go_color 000000 +tide_go_icon  +tide_jobs_bg_color 444444 +tide_jobs_color 4E9A06 +tide_jobs_icon '' +tide_kubectl_bg_color 326CE5 +tide_kubectl_color 000000 +tide_kubectl_icon '⎈' +tide_left_prompt_frame_enabled true +tide_left_prompt_items pwd git newline +tide_left_prompt_prefix '' +tide_left_prompt_separator_diff_color '' +tide_left_prompt_separator_same_color '' +tide_left_prompt_suffix '' +tide_node_bg_color 44883E +tide_node_color 000000 +tide_node_icon '⬢' +tide_os_bg_color CED7CF +tide_os_color 080808 +tide_php_bg_color 617CBE +tide_php_color 000000 +tide_php_icon '' +tide_prompt_add_newline_before true +tide_prompt_color_frame_and_connection 6C6C6C +tide_prompt_color_separator_same_color 949494 +tide_prompt_icon_connection ' ' +tide_prompt_min_cols 26 +tide_prompt_pad_items true +tide_pwd_bg_color 3465A4 +tide_pwd_color_anchors E4E4E4 +tide_pwd_color_dirs E4E4E4 +tide_pwd_color_truncated_dirs BCBCBC +tide_pwd_icon +tide_pwd_icon_home +tide_pwd_icon_unwritable '' +tide_pwd_markers .bzr .citc .git .hg .node-version .python-version .ruby-version .shorten_folder_marker .svn .terraform Cargo.toml composer.json CVS go.mod package.json +tide_right_prompt_frame_enabled true +tide_right_prompt_items status cmd_duration context jobs node virtual_env rustc php chruby go kubectl terraform vi_mode +tide_right_prompt_prefix '' +tide_right_prompt_separator_diff_color '' +tide_right_prompt_separator_same_color '' +tide_right_prompt_suffix '' +tide_rustc_bg_color F74C00 +tide_rustc_color 000000 +tide_rustc_icon '' +tide_shlvl_bg_color 808000 +tide_shlvl_color 000000 +tide_shlvl_icon '' +tide_shlvl_threshold 1 +tide_status_bg_color 2E3436 +tide_status_bg_color_failure CC0000 +tide_status_color 4E9A06 +tide_status_color_failure FFFF00 +tide_status_icon '✔' +tide_status_icon_failure '✘' +tide_terraform_bg_color 800080 +tide_terraform_color 000000 +tide_terraform_icon +tide_time_bg_color D3D7CF +tide_time_color 000000 +tide_time_format '%T' +tide_vi_mode_bg_color_default 008000 +tide_vi_mode_bg_color_replace 808000 +tide_vi_mode_bg_color_visual 000080 +tide_vi_mode_color_default 000000 +tide_vi_mode_color_replace 000000 +tide_vi_mode_color_visual 000000 +tide_vi_mode_icon_default DEFAULT +tide_vi_mode_icon_replace REPLACE +tide_vi_mode_icon_visual VISUAL +tide_virtual_env_bg_color 444444 +tide_virtual_env_color 00AFAF +tide_virtual_env_icon '' diff --git a/fish/.config/fish/functions/tide/configure/configs/rainbow_16color.fish b/fish/.config/fish/functions/tide/configure/configs/rainbow_16color.fish new file mode 100644 index 0000000..c38b6c5 --- /dev/null +++ b/fish/.config/fish/functions/tide/configure/configs/rainbow_16color.fish @@ -0,0 +1,59 @@ +tide_character_color brgreen +tide_character_color_failure brred +tide_chruby_bg_color red +tide_chruby_color black +tide_cmd_duration_bg_color yellow +tide_cmd_duration_color black +tide_context_bg_color brblack +tide_context_color_default yellow +tide_context_color_root yellow +tide_context_color_ssh yellow +tide_git_bg_color green +tide_git_bg_color_unstable yellow +tide_git_bg_color_urgent red +tide_git_color_branch black +tide_git_color_conflicted black +tide_git_color_dirty black +tide_git_color_operation black +tide_git_color_staged black +tide_git_color_stash black +tide_git_color_untracked black +tide_git_color_upstream black +tide_go_bg_color brcyan +tide_go_color black +tide_jobs_bg_color brblack +tide_jobs_color green +tide_kubectl_bg_color blue +tide_kubectl_color black +tide_node_bg_color green +tide_node_color black +tide_os_bg_color white +tide_os_color black +tide_php_bg_color blue +tide_php_color black +tide_prompt_color_frame_and_connection brblack +tide_prompt_color_separator_same_color brblack +tide_pwd_bg_color blue +tide_pwd_color_anchors brwhite +tide_pwd_color_dirs brwhite +tide_pwd_color_truncated_dirs white +tide_rustc_bg_color red +tide_rustc_color black +tide_shlvl_bg_color yellow +tide_shlvl_color black +tide_status_bg_color black +tide_status_bg_color_failure red +tide_status_color green +tide_status_color_failure bryellow +tide_terraform_bg_color magenta +tide_terraform_color black +tide_time_bg_color white +tide_time_color black +tide_vi_mode_bg_color_default green +tide_vi_mode_bg_color_replace yellow +tide_vi_mode_bg_color_visual blue +tide_vi_mode_color_default black +tide_vi_mode_color_replace black +tide_vi_mode_color_visual black +tide_virtual_env_bg_color brblack +tide_virtual_env_color cyan diff --git a/fish/.config/fish/functions/tide/configure/functions/_fake_tide_item_cmd_duration.fish b/fish/.config/fish/functions/tide/configure/functions/_fake_tide_item_cmd_duration.fish new file mode 100644 index 0000000..5aa13b2 --- /dev/null +++ b/fish/.config/fish/functions/tide/configure/functions/_fake_tide_item_cmd_duration.fish @@ -0,0 +1,3 @@ +function _fake_tide_item_cmd_duration + _fake_tide_print_item cmd_duration $fake_tide_cmd_duration_icon' ' 5s +end diff --git a/fish/.config/fish/functions/tide/configure/functions/_fake_tide_item_git.fish b/fish/.config/fish/functions/tide/configure/functions/_fake_tide_item_git.fish new file mode 100644 index 0000000..fb5b957 --- /dev/null +++ b/fish/.config/fish/functions/tide/configure/functions/_fake_tide_item_git.fish @@ -0,0 +1,3 @@ +function _fake_tide_item_git + _fake_tide_print_item git (set_color $fake_tide_git_color_branch) $fake_tide_git_icon' ' main +end diff --git a/fish/.config/fish/functions/tide/configure/functions/_fake_tide_item_newline.fish b/fish/.config/fish/functions/tide/configure/functions/_fake_tide_item_newline.fish new file mode 100644 index 0000000..0bbdc03 --- /dev/null +++ b/fish/.config/fish/functions/tide/configure/functions/_fake_tide_item_newline.fish @@ -0,0 +1,5 @@ +function _fake_tide_item_newline + set_color $_fake_tide_previous_bg_color -b normal + side_working_on_suffix_name=fake_tide_"$_fake_tide_which_side_working_on"_prompt_suffix printf '%s' $$side_working_on_suffix_name \n + set -g _fake_tide_last_item newline +end diff --git a/fish/.config/fish/functions/tide/configure/functions/_fake_tide_item_os.fish b/fish/.config/fish/functions/tide/configure/functions/_fake_tide_item_os.fish new file mode 100644 index 0000000..d094a8e --- /dev/null +++ b/fish/.config/fish/functions/tide/configure/functions/_fake_tide_item_os.fish @@ -0,0 +1,3 @@ +function _fake_tide_item_os + _fake_tide_print_item os $tide_os_icon +end diff --git a/fish/.config/fish/functions/tide/configure/functions/_fake_tide_item_prompt_char.fish b/fish/.config/fish/functions/tide/configure/functions/_fake_tide_item_prompt_char.fish new file mode 100644 index 0000000..e405b22 --- /dev/null +++ b/fish/.config/fish/functions/tide/configure/functions/_fake_tide_item_prompt_char.fish @@ -0,0 +1,3 @@ +function _fake_tide_item_character + _fake_tide_print_item character '❯ ' +end diff --git a/fish/.config/fish/functions/tide/configure/functions/_fake_tide_item_pwd.fish b/fish/.config/fish/functions/tide/configure/functions/_fake_tide_item_pwd.fish new file mode 100644 index 0000000..68c2447 --- /dev/null +++ b/fish/.config/fish/functions/tide/configure/functions/_fake_tide_item_pwd.fish @@ -0,0 +1,7 @@ +function _fake_tide_item_pwd + _fake_tide_print_item pwd \ + (set_color $fake_tide_pwd_color_dirs)$fake_tide_pwd_icon' ' \ + (set_color -o $fake_tide_pwd_color_anchors)'~'(set_color normal -b $fake_tide_pwd_bg_color) \ + (set_color $fake_tide_pwd_color_dirs)'/'(set_color normal -b $fake_tide_pwd_bg_color) \ + (set_color -o $fake_tide_pwd_color_anchors)'src'(set_color normal -b $fake_tide_pwd_bg_color) +end diff --git a/fish/.config/fish/functions/tide/configure/functions/_fake_tide_item_time.fish b/fish/.config/fish/functions/tide/configure/functions/_fake_tide_item_time.fish new file mode 100644 index 0000000..bbce0b5 --- /dev/null +++ b/fish/.config/fish/functions/tide/configure/functions/_fake_tide_item_time.fish @@ -0,0 +1,3 @@ +function _fake_tide_item_time + _fake_tide_print_item time (date +$fake_tide_time_format) +end diff --git a/fish/.config/fish/functions/tide/configure/functions/_fake_tide_print_item.fish b/fish/.config/fish/functions/tide/configure/functions/_fake_tide_print_item.fish new file mode 100644 index 0000000..fc6081c --- /dev/null +++ b/fish/.config/fish/functions/tide/configure/functions/_fake_tide_print_item.fish @@ -0,0 +1,38 @@ +function _fake_tide_print_item -a item + item_bg_color_name=fake_tide_"$item"_bg_color set item_bg_color $$item_bg_color_name + + if test "$_fake_tide_which_side_working_on" = left + if test "$_fake_tide_last_item" = newline + if test "$item" != character + set_color $item_bg_color -b normal + printf '%s' $fake_tide_left_prompt_prefix + end + else if test "$item_bg_color" = "$_fake_tide_previous_bg_color" + set_color $fake_tide_prompt_color_separator_same_color + printf '%s' $fake_tide_left_prompt_separator_same_color + else + set_color $_fake_tide_previous_bg_color -b $item_bg_color + printf '%s' $fake_tide_left_prompt_separator_diff_color + end + else if test "$_fake_tide_last_item" = newline + set_color $item_bg_color -b normal + printf '%s' $fake_tide_right_prompt_prefix + else if test "$item_bg_color" = "$_fake_tide_previous_bg_color" + set_color $fake_tide_prompt_color_separator_same_color + printf '%s' $fake_tide_right_prompt_separator_same_color + else + set_color $item_bg_color -b $_fake_tide_previous_bg_color + printf '%s' $fake_tide_right_prompt_separator_diff_color + end + + item_color_name=fake_tide_"$item"_color set_color $$item_color_name -b $item_bg_color + + if test "$fake_tide_prompt_pad_items" = true -a "$item" != character + printf '%s' ' ' $argv[2..] ' ' + else + printf '%s' $argv[2..] + end + + set -g _fake_tide_previous_bg_color $item_bg_color + set -g _fake_tide_last_item $item +end diff --git a/fish/.config/fish/functions/tide/configure/functions/_fake_tide_prompt.fish b/fish/.config/fish/functions/tide/configure/functions/_fake_tide_prompt.fish new file mode 100644 index 0000000..56ea5c8 --- /dev/null +++ b/fish/.config/fish/functions/tide/configure/functions/_fake_tide_prompt.fish @@ -0,0 +1,66 @@ +function _fake_tide_prompt + left_prompt=(_fake_tide_left_prompt) right_prompt=(_fake_tide_right_prompt) if set -q left_prompt[2] # If prompt is two lines + set -l _tide_prompt_and_frame_color (set_color $fake_tide_prompt_color_frame_and_connection -b normal || echo) + + if test "$fake_tide_left_prompt_frame_enabled" = true + set left_prompt[1] $_tide_prompt_and_frame_color╭─"$left_prompt[1]" + set left_prompt[2] $_tide_prompt_and_frame_color╰─"$left_prompt[2]" + end + if test "$fake_tide_right_prompt_frame_enabled" = true + set right_prompt[1] "$right_prompt[1]"$_tide_prompt_and_frame_color─╮ + set right_prompt[2] "$right_prompt[2]"$_tide_prompt_and_frame_color─╯ + end + + printf '%s' $left_prompt[1] $_tide_prompt_and_frame_color + + set -l dist_btwn_sides (math $fake_columns - ( # Regex removes color codes + string replace -ar '\e(\[[\d;]*|\(B\e\[)m(\co)?' '' "$left_prompt[1]""$right_prompt[1]" | string length)) + test $dist_btwn_sides -gt 0 && string repeat --no-newline --max $dist_btwn_sides $fake_tide_prompt_icon_connection + + printf '%s' $right_prompt[1] \n $left_prompt[-1]' ' + + string repeat --no-newline --max (math $fake_columns - ( # The -1 is necessary for some reason + string replace -ar '\e(\[[\d;]*|\(B\e\[)m(\co)?' '' "$left_prompt[-1]""$right_prompt[-1]" | string length) - 1) ' ' + printf '%s' $right_prompt[2] + else + printf '%s' $left_prompt[-1]' ' + + string repeat --no-newline --max (math $fake_columns - ( # The -1 is necessary for some reason + string replace -ar '\e(\[[\d;]*|\(B\e\[)m(\co)?' '' "$left_prompt[-1]""$right_prompt[-1]" | string length) - 1) ' ' + printf '%s' $right_prompt[-1] + end + + set_color normal +end + +function _fake_tide_left_prompt + set -g _fake_tide_last_item newline + set -g _fake_tide_which_side_working_on left + + for item in $fake_tide_left_prompt_items + _fake_tide_item_$item + end + + if not contains -- $_fake_tide_last_item newline character + set_color $_fake_tide_previous_bg_color -b normal + printf '%s' $fake_tide_left_prompt_suffix + end + + set_color normal # Make sure there is something printed on the last line +end + +function _fake_tide_right_prompt + set -g _fake_tide_last_item newline + set -g _fake_tide_which_side_working_on right + + for item in $fake_tide_right_prompt_items + _fake_tide_item_$item + end + + if test "$_fake_tide_last_item" != newline + set_color $_fake_tide_previous_bg_color -b normal + printf '%s' $fake_tide_right_prompt_suffix + end + + set_color normal # Make sure there is something printed on the last line +end