diff options
Diffstat (limited to 'home-config/fish/functions/tide/configure/choices/all')
9 files changed, 289 insertions, 0 deletions
diff --git a/home-config/fish/functions/tide/configure/choices/all/finish.fish b/home-config/fish/functions/tide/configure/choices/all/finish.fish new file mode 100644 index 0000000..f670b1e --- /dev/null +++ b/home-config/fish/functions/tide/configure/choices/all/finish.fish | |||
@@ -0,0 +1,46 @@ | |||
1 | function finish | ||
2 | _tide_title Finish | ||
3 | |||
4 | echo | ||
5 | set_color red | ||
6 | _tide_option y 'Overwrite your current tide config' | ||
7 | set_color normal | ||
8 | echo | ||
9 | |||
10 | _tide_option p 'Exit and print the config you just generated' | ||
11 | echo | ||
12 | |||
13 | _tide_menu (status function) | ||
14 | switch $_tide_selected_option | ||
15 | case 'Overwrite your current tide config' | ||
16 | _tide_finish | ||
17 | command -q clear && clear | ||
18 | set -q _flag_auto || _tide_print_configure_current_options | ||
19 | case 'Exit and print the config you just generated' | ||
20 | _tide_exit_configure | ||
21 | command -q clear && clear | ||
22 | _tide_print_configure_current_options | ||
23 | end | ||
24 | end | ||
25 | |||
26 | function _tide_finish | ||
27 | _tide_exit_configure | ||
28 | |||
29 | # Deal with prompt char/vi mode | ||
30 | contains character $fake_tide_left_prompt_items || set -p fake_tide_left_prompt_items vi_mode | ||
31 | |||
32 | # Set the real variables | ||
33 | for fakeVar in (set --names | string match -r "^fake_tide.*") | ||
34 | set -U (string replace 'fake_' '' $fakeVar) $$fakeVar | ||
35 | end | ||
36 | |||
37 | # Make sure old prompt won't display | ||
38 | set -e $_tide_prompt_var 2>/dev/null | ||
39 | |||
40 | # Re-initialize the prompt | ||
41 | tide reload | ||
42 | end | ||
43 | |||
44 | function _tide_print_configure_current_options | ||
45 | _tide_fish_colorize "tide configure --auto $_tide_configure_current_options" | ||
46 | end | ||
diff --git a/home-config/fish/functions/tide/configure/choices/all/icons.fish b/home-config/fish/functions/tide/configure/choices/all/icons.fish new file mode 100644 index 0000000..be167bb --- /dev/null +++ b/home-config/fish/functions/tide/configure/choices/all/icons.fish | |||
@@ -0,0 +1,33 @@ | |||
1 | function icons | ||
2 | _tide_title Icons | ||
3 | |||
4 | _tide_option 1 'Few icons' | ||
5 | _tide_display_prompt | ||
6 | |||
7 | _tide_option 2 'Many icons' | ||
8 | _enable_icons | ||
9 | _tide_display_prompt | ||
10 | |||
11 | _tide_menu (status function) | ||
12 | switch $_tide_selected_option | ||
13 | case 'Few icons' | ||
14 | _disable_icons | ||
15 | end | ||
16 | _next_choice all/transient | ||
17 | end | ||
18 | |||
19 | function _enable_icons | ||
20 | set -p fake_tide_left_prompt_items os | ||
21 | set -g fake_tide_pwd_icon | ||
22 | set -g fake_tide_pwd_icon_home | ||
23 | set -g fake_tide_cmd_duration_icon | ||
24 | set -g fake_tide_git_icon | ||
25 | end | ||
26 | |||
27 | function _disable_icons | ||
28 | _tide_find_and_remove os fake_tide_left_prompt_items | ||
29 | set fake_tide_pwd_icon | ||
30 | set fake_tide_pwd_icon_home | ||
31 | set fake_tide_cmd_duration_icon | ||
32 | set fake_tide_git_icon | ||
33 | end | ||
diff --git a/home-config/fish/functions/tide/configure/choices/all/prompt_colors.fish b/home-config/fish/functions/tide/configure/choices/all/prompt_colors.fish new file mode 100644 index 0000000..247ef4e --- /dev/null +++ b/home-config/fish/functions/tide/configure/choices/all/prompt_colors.fish | |||
@@ -0,0 +1,26 @@ | |||
1 | function prompt_colors | ||
2 | _tide_title 'Prompt Colors' | ||
3 | |||
4 | _tide_option 1 'True color' | ||
5 | _tide_display_prompt | ||
6 | |||
7 | _tide_option 2 '16 colors' | ||
8 | _load_config "$_tide_configure_style"_16color | ||
9 | set -g _tide_16color true | ||
10 | _tide_display_prompt | ||
11 | |||
12 | _tide_menu (status function) | ||
13 | switch $_tide_selected_option | ||
14 | case 'True color' | ||
15 | _load_config "$_tide_configure_style" | ||
16 | set -e _tide_16color | ||
17 | switch $_tide_configure_style | ||
18 | case lean rainbow | ||
19 | _next_choice all/show_time | ||
20 | case classic | ||
21 | _next_choice classic/classic_prompt_color | ||
22 | end | ||
23 | case '16 colors' | ||
24 | _next_choice all/show_time | ||
25 | end | ||
26 | end | ||
diff --git a/home-config/fish/functions/tide/configure/choices/all/prompt_connection.fish b/home-config/fish/functions/tide/configure/choices/all/prompt_connection.fish new file mode 100644 index 0000000..ff76546 --- /dev/null +++ b/home-config/fish/functions/tide/configure/choices/all/prompt_connection.fish | |||
@@ -0,0 +1,31 @@ | |||
1 | function prompt_connection | ||
2 | _tide_title 'Prompt Connection' | ||
3 | |||
4 | _tide_option 1 Disconnected | ||
5 | set -g fake_tide_prompt_icon_connection ' ' | ||
6 | _tide_display_prompt | ||
7 | |||
8 | _tide_option 2 Dotted | ||
9 | set -g fake_tide_prompt_icon_connection '·' | ||
10 | _tide_display_prompt | ||
11 | |||
12 | _tide_option 3 Solid | ||
13 | set -g fake_tide_prompt_icon_connection '─' | ||
14 | _tide_display_prompt | ||
15 | |||
16 | _tide_menu (status function) | ||
17 | switch $_tide_selected_option | ||
18 | case Disconnected | ||
19 | set -g fake_tide_prompt_icon_connection ' ' | ||
20 | case Dotted | ||
21 | set -g fake_tide_prompt_icon_connection '·' | ||
22 | case Solid | ||
23 | set -g fake_tide_prompt_icon_connection '─' | ||
24 | end | ||
25 | switch $_tide_configure_style | ||
26 | case lean | ||
27 | _next_choice all/prompt_connection_andor_frame_color | ||
28 | case classic rainbow | ||
29 | _next_choice powerline/powerline_right_prompt_frame | ||
30 | end | ||
31 | end | ||
diff --git a/home-config/fish/functions/tide/configure/choices/all/prompt_connection_andor_frame_color.fish b/home-config/fish/functions/tide/configure/choices/all/prompt_connection_andor_frame_color.fish new file mode 100644 index 0000000..cefbf2c --- /dev/null +++ b/home-config/fish/functions/tide/configure/choices/all/prompt_connection_andor_frame_color.fish | |||
@@ -0,0 +1,40 @@ | |||
1 | function prompt_connection_andor_frame_color | ||
2 | if test "$_tide_16color" = true || | ||
3 | test "$fake_tide_left_prompt_frame_enabled" = false -a \ | ||
4 | "$fake_tide_right_prompt_frame_enabled" = false -a \ | ||
5 | "$fake_tide_prompt_icon_connection" = ' ' | ||
6 | _next_choice all/prompt_spacing | ||
7 | return 0 | ||
8 | end | ||
9 | |||
10 | _tide_title "Connection & Frame Color" | ||
11 | |||
12 | _tide_option 1 Lightest | ||
13 | set -g fake_tide_prompt_color_frame_and_connection 808080 | ||
14 | _tide_display_prompt | ||
15 | |||
16 | _tide_option 2 Light | ||
17 | set -g fake_tide_prompt_color_frame_and_connection 6C6C6C | ||
18 | _tide_display_prompt | ||
19 | |||
20 | _tide_option 3 Dark | ||
21 | set -g fake_tide_prompt_color_frame_and_connection 585858 | ||
22 | _tide_display_prompt | ||
23 | |||
24 | _tide_option 4 Darkest | ||
25 | set -g fake_tide_prompt_color_frame_and_connection 444444 | ||
26 | _tide_display_prompt | ||
27 | |||
28 | _tide_menu (status function) | ||
29 | switch $_tide_selected_option | ||
30 | case Lightest | ||
31 | set -g fake_tide_prompt_color_frame_and_connection 808080 | ||
32 | case Light | ||
33 | set -g fake_tide_prompt_color_frame_and_connection 6C6C6C | ||
34 | case Dark | ||
35 | set -g fake_tide_prompt_color_frame_and_connection 585858 | ||
36 | case Darkest | ||
37 | set -g fake_tide_prompt_color_frame_and_connection 444444 | ||
38 | end | ||
39 | _next_choice all/prompt_spacing | ||
40 | end | ||
diff --git a/home-config/fish/functions/tide/configure/choices/all/prompt_spacing.fish b/home-config/fish/functions/tide/configure/choices/all/prompt_spacing.fish new file mode 100644 index 0000000..f68be68 --- /dev/null +++ b/home-config/fish/functions/tide/configure/choices/all/prompt_spacing.fish | |||
@@ -0,0 +1,22 @@ | |||
1 | function prompt_spacing | ||
2 | _tide_title 'Prompt Spacing' | ||
3 | |||
4 | _tide_option 1 Compact | ||
5 | set -g fake_tide_prompt_add_newline_before false | ||
6 | _tide_display_prompt | ||
7 | _tide_display_prompt | ||
8 | |||
9 | _tide_option 2 Sparse | ||
10 | set -g fake_tide_prompt_add_newline_before true | ||
11 | _tide_display_prompt | ||
12 | _tide_display_prompt | ||
13 | |||
14 | _tide_menu (status function) | ||
15 | switch $_tide_selected_option | ||
16 | case Compact | ||
17 | set -g fake_tide_prompt_add_newline_before false | ||
18 | case Sparse | ||
19 | set -g fake_tide_prompt_add_newline_before true | ||
20 | end | ||
21 | _next_choice all/icons | ||
22 | end | ||
diff --git a/home-config/fish/functions/tide/configure/choices/all/show_time.fish b/home-config/fish/functions/tide/configure/choices/all/show_time.fish new file mode 100644 index 0000000..b66c785 --- /dev/null +++ b/home-config/fish/functions/tide/configure/choices/all/show_time.fish | |||
@@ -0,0 +1,33 @@ | |||
1 | function show_time | ||
2 | _tide_title 'Show current time?' | ||
3 | |||
4 | _tide_option 1 No | ||
5 | _tide_display_prompt | ||
6 | |||
7 | set -a fake_tide_right_prompt_items time | ||
8 | |||
9 | _tide_option 2 '24-hour format' | ||
10 | set -g fake_tide_time_format %T | ||
11 | _tide_display_prompt | ||
12 | |||
13 | _tide_option 3 '12-hour format' | ||
14 | set -g fake_tide_time_format %r | ||
15 | _tide_display_prompt | ||
16 | |||
17 | _tide_menu (status function) | ||
18 | switch $_tide_selected_option | ||
19 | case No | ||
20 | set -g fake_tide_time_format '' | ||
21 | set -e fake_tide_right_prompt_items[-1] | ||
22 | case '24-hour format' | ||
23 | set -g fake_tide_time_format %T | ||
24 | case '12-hour format' | ||
25 | set -g fake_tide_time_format %r | ||
26 | end | ||
27 | switch $_tide_configure_style | ||
28 | case lean | ||
29 | _next_choice "$_tide_configure_style"/"$_tide_configure_style"_prompt_height | ||
30 | case classic rainbow | ||
31 | _next_choice "$_tide_configure_style"/"$_tide_configure_style"_prompt_separators | ||
32 | end | ||
33 | end | ||
diff --git a/home-config/fish/functions/tide/configure/choices/all/style.fish b/home-config/fish/functions/tide/configure/choices/all/style.fish new file mode 100644 index 0000000..fe9a58f --- /dev/null +++ b/home-config/fish/functions/tide/configure/choices/all/style.fish | |||
@@ -0,0 +1,36 @@ | |||
1 | function style | ||
2 | set -g _tide_configure_current_options | ||
3 | |||
4 | _tide_title 'Prompt Style' | ||
5 | |||
6 | _tide_option 1 Lean | ||
7 | _load_config lean | ||
8 | _tide_display_prompt | ||
9 | |||
10 | _tide_option 2 Classic | ||
11 | _load_config classic | ||
12 | _tide_display_prompt | ||
13 | |||
14 | _tide_option 3 Rainbow | ||
15 | _load_config rainbow | ||
16 | _tide_display_prompt | ||
17 | |||
18 | _tide_menu (status function) --no-restart | ||
19 | switch $_tide_selected_option | ||
20 | case Lean | ||
21 | _load_config lean | ||
22 | set -g _tide_configure_style lean | ||
23 | case Classic | ||
24 | _load_config classic | ||
25 | set -g _tide_configure_style classic | ||
26 | case Rainbow | ||
27 | _load_config rainbow | ||
28 | set -g _tide_configure_style rainbow | ||
29 | end | ||
30 | _next_choice all/prompt_colors | ||
31 | end | ||
32 | |||
33 | function _load_config -a name | ||
34 | string replace -r '^' 'set -g fake_' <(status dirname)/../../icons.fish | source | ||
35 | string replace -r '^' 'set -g fake_' <(status dirname)/../../configs/$name.fish | source | ||
36 | end | ||
diff --git a/home-config/fish/functions/tide/configure/choices/all/transient.fish b/home-config/fish/functions/tide/configure/choices/all/transient.fish new file mode 100644 index 0000000..df2b6b6 --- /dev/null +++ b/home-config/fish/functions/tide/configure/choices/all/transient.fish | |||
@@ -0,0 +1,22 @@ | |||
1 | function transient | ||
2 | _tide_title 'Enable transient prompt?' | ||
3 | |||
4 | _tide_option 1 No | ||
5 | _tide_display_prompt | ||
6 | _tide_display_prompt | ||
7 | _tide_display_prompt | ||
8 | |||
9 | _tide_option 2 Yes | ||
10 | _configure_transient= _tide_display_prompt | ||
11 | _configure_transient= _tide_display_prompt | ||
12 | _tide_display_prompt | ||
13 | |||
14 | _tide_menu (status function) | ||
15 | switch $_tide_selected_option | ||
16 | case No | ||
17 | set fake_tide_prompt_transient_enabled false | ||
18 | case Yes | ||
19 | set fake_tide_prompt_transient_enabled true | ||
20 | end | ||
21 | _next_choice all/finish | ||
22 | end | ||