home-config/fish/functions/tide/configure/functions/_fake_tide_cache_variables.fish
930ee9064a9bda8adaa2d64ed66eb6a84fd7bc09
· 1.5 KB · 41 lines
raw
| 1 | function _fake_tide_cache_variables |
| 2 | # pwd |
| 3 | set_color -o $fake_tide_pwd_color_anchors | read -gx _fake_tide_color_anchors |
| 4 | set -gx _fake_tide_color_truncated_dirs "$(set_color $fake_tide_pwd_color_truncated_dirs)" |
| 5 | set -gx _fake_tide_reset_to_color_dirs (set_color normal -b $fake_tide_pwd_bg_color; set_color $fake_tide_pwd_color_dirs) |
| 6 | |
| 7 | # git |
| 8 | contains git $fake_tide_left_prompt_items $fake_tide_right_prompt_items && |
| 9 | set -gx _fake_tide_location_color "$(set_color $fake_tide_git_color_branch)" |
| 10 | |
| 11 | # private_mode |
| 12 | if contains private_mode $fake_tide_left_prompt_items $fake_tide_right_prompt_items && test -n "$fish_private_mode" |
| 13 | set -gx _fake_tide_private_mode |
| 14 | else |
| 15 | set -e _fake_tide_private_mode |
| 16 | end |
| 17 | |
| 18 | # Same-color-separator color |
| 19 | set -gx _fake_tide_color_separator_same_color "$(set_color $fake_tide_prompt_color_separator_same_color)" |
| 20 | |
| 21 | # two line prompt |
| 22 | if contains newline $fake_tide_left_prompt_items |
| 23 | set_color $fake_tide_prompt_color_frame_and_connection -b normal | read -gx _fake_tide_prompt_and_frame_color |
| 24 | else |
| 25 | set -e _fake_tide_prompt_and_frame_color |
| 26 | end |
| 27 | |
| 28 | # newline before |
| 29 | if test "$fake_tide_prompt_add_newline_before" = true |
| 30 | set -g _fake_tide_add_newline '' |
| 31 | else |
| 32 | set -e _fake_tide_add_newline |
| 33 | end |
| 34 | |
| 35 | # item padding |
| 36 | if test "$fake_tide_prompt_pad_items" = true |
| 37 | set -gx _fake_tide_pad ' ' |
| 38 | else |
| 39 | set -e _fake_tide_pad |
| 40 | end |
| 41 | end |