home-config/fish/functions/tide/configure/choices/all/show_time.fish

08263029b9253c794b2eb67628250c80ebdac341 · 957 B · 33 lines raw

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