tide/conf.d/_tide_init.fish

44 lines
1.5 KiB
Fish
Raw Normal View History

2020-10-13 01:05:51 +03:00
function _tide_init_install --on-event _tide_init_install
set -U _tide_var_list
2021-01-27 02:33:10 +03:00
# Tiny improvment to shell startup, which makes async faster
function _tide_set -a var_name
set -U $var_name $argv[2..-1]
set -a _tide_var_list $var_name
end
_tide_set _tide_color_dark_blue 0087AF
_tide_set _tide_color_dark_green 5FAF00
_tide_set _tide_color_gold D7AF00
_tide_set _tide_color_green 5FD700
_tide_set _tide_color_light_blue 00AFFF
2020-10-13 01:05:51 +03:00
2021-01-25 17:51:46 +03:00
# Each string replace is kind of dirname
2021-01-27 02:33:10 +03:00
_tide_set _tide_root (status filename | string replace --regex '/[^/]+$' '' | string replace --regex '/[^/]+$' '')
2020-10-13 01:05:51 +03:00
_tide_set VIRTUAL_ENV_DISABLE_PROMPT true
2020-10-13 01:05:51 +03:00
2021-01-25 18:13:06 +03:00
source $_tide_root/functions/tide/configure/choices/all/style.fish
2021-02-17 07:57:12 +03:00
source $_tide_root/functions/tide/configure/choices/all/finish.fish
2020-10-13 01:05:51 +03:00
_load_config 'lean'
2021-02-17 07:57:12 +03:00
_tide_finish
set -a _tide_var_list (set --names | string match --regex "^tide.*")
2020-10-13 01:05:51 +03:00
status is-interactive && switch (read --prompt-str="Configure tide prompt? [Y/n] " | string lower)
case y ye yes ''
tide configure
case '*'
printf '%s' \n 'Run ' (set_color $fish_color_command) 'tide ' \
(set_color $fish_color_param) 'configure ' (set_color normal) 'to customize your prompt.' \n
2020-10-13 01:05:51 +03:00
end
end
2020-10-16 01:15:17 +03:00
function _tide_init_uninstall --on-event _tide_init_uninstall
for var in $_tide_var_list
2020-10-16 01:15:17 +03:00
set -e $var
end
set -e _tide_var_list
functions --erase (functions --all | string match --entire --regex '^_tide_')
2020-10-16 01:15:17 +03:00
end