tide/conf.d/_tide_init.fish

42 lines
1.4 KiB
Fish
Raw Normal View History

2020-10-13 01:05:51 +03:00
function _tide_init_install --on-event _tide_init_install
_set_immutable _tide_color_dark_blue 0087AF
_set_immutable _tide_color_dark_green 5FAF00
_set_immutable _tide_color_gold D7AF00
_set_immutable _tide_color_green 5FD700
_set_immutable _tide_color_light_blue 00AFFF
2021-01-25 17:51:46 +03:00
# Each string replace is kind of dirname
_set_immutable _tide_root (status current-filename | string replace --regex '/[^/]+$' '' | string replace --regex '/[^/]+$' '')
2020-10-13 01:05:51 +03:00
_set_immutable VIRTUAL_ENV_DISABLE_PROMPT true
set -U _tide_var_list
source $_tide_root/functions/_tide_sub_configure.fish
2020-10-13 01:05:51 +03:00
_load_config 'lean'
_tide_finish
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_immutable_list $_tide_var_list
set -e $var
end
set -e _tide_var_immutable_list
set -e _tide_var_list
functions --erase (functions --all | string match --entire --regex '^_tide_')
2020-10-16 01:15:17 +03:00
end
2020-10-13 01:05:51 +03:00
function _set_immutable -a var_name
set -U $var_name $argv[2..-1]
set -Ua _tide_var_immutable_list $var_name
end