Update tide to v6
This commit is contained in:
@@ -1,21 +1,30 @@
|
||||
function finish
|
||||
set_color red
|
||||
_tide_title 'Overwrite tide config?'
|
||||
set_color normal
|
||||
_tide_title Finish
|
||||
|
||||
_tide_option y Yes
|
||||
echo
|
||||
set_color red
|
||||
_tide_option y 'Overwrite your current tide config'
|
||||
set_color normal
|
||||
echo
|
||||
|
||||
_tide_menu
|
||||
_tide_option p 'Exit and print the config you just generated'
|
||||
echo
|
||||
|
||||
_tide_menu (status function)
|
||||
switch $_tide_selected_option
|
||||
case y
|
||||
case 'Overwrite your current tide config'
|
||||
_tide_finish
|
||||
command -q clear && clear
|
||||
set -q _flag_auto || _tide_print_configure_current_options
|
||||
case 'Exit and print the config you just generated'
|
||||
_tide_exit_configure
|
||||
command -q clear && clear
|
||||
_tide_print_configure_current_options
|
||||
end
|
||||
end
|
||||
|
||||
function _tide_finish
|
||||
set -e _tide_selected_option # Skip through all the _next_choices
|
||||
_tide_exit_configure
|
||||
|
||||
# Deal with prompt char/vi mode
|
||||
contains character $fake_tide_left_prompt_items || set -p fake_tide_left_prompt_items vi_mode
|
||||
@@ -29,5 +38,9 @@ function _tide_finish
|
||||
set -e $_tide_prompt_var 2>/dev/null
|
||||
|
||||
# Re-initialize the prompt
|
||||
source (functions --details fish_prompt)
|
||||
tide reload
|
||||
end
|
||||
|
||||
function _tide_print_configure_current_options
|
||||
_tide_fish_colorize "tide configure --auto $_tide_configure_current_options"
|
||||
end
|
||||
|
@@ -8,12 +8,12 @@ function icons
|
||||
_enable_icons
|
||||
_tide_display_prompt
|
||||
|
||||
_tide_menu
|
||||
_tide_menu (status function)
|
||||
switch $_tide_selected_option
|
||||
case 1
|
||||
case 'Few icons'
|
||||
_disable_icons
|
||||
end
|
||||
_next_choice all/finish
|
||||
_next_choice all/transient
|
||||
end
|
||||
|
||||
function _enable_icons
|
||||
|
@@ -9,9 +9,9 @@ function prompt_colors
|
||||
set -g _tide_16color true
|
||||
_tide_display_prompt
|
||||
|
||||
_tide_menu
|
||||
_tide_menu (status function)
|
||||
switch $_tide_selected_option
|
||||
case 1
|
||||
case 'True color'
|
||||
_load_config "$_tide_configure_style"
|
||||
set -e _tide_16color
|
||||
switch $_tide_configure_style
|
||||
@@ -20,7 +20,7 @@ function prompt_colors
|
||||
case classic
|
||||
_next_choice classic/classic_prompt_color
|
||||
end
|
||||
case 2
|
||||
case '16 colors'
|
||||
_next_choice all/show_time
|
||||
end
|
||||
end
|
||||
|
@@ -2,27 +2,30 @@ function prompt_connection
|
||||
_tide_title 'Prompt Connection'
|
||||
|
||||
_tide_option 1 Disconnected
|
||||
_tide_display_prompt fake_tide_prompt_icon_connection ' '
|
||||
set -g fake_tide_prompt_icon_connection ' '
|
||||
_tide_display_prompt
|
||||
|
||||
_tide_option 2 Dotted
|
||||
_tide_display_prompt fake_tide_prompt_icon_connection '·'
|
||||
set -g fake_tide_prompt_icon_connection '·'
|
||||
_tide_display_prompt
|
||||
|
||||
_tide_option 3 Solid
|
||||
_tide_display_prompt fake_tide_prompt_icon_connection '─'
|
||||
set -g fake_tide_prompt_icon_connection '─'
|
||||
_tide_display_prompt
|
||||
|
||||
_tide_menu
|
||||
_tide_menu (status function)
|
||||
switch $_tide_selected_option
|
||||
case 1
|
||||
case Disconnected
|
||||
set -g fake_tide_prompt_icon_connection ' '
|
||||
case 2
|
||||
case Dotted
|
||||
set -g fake_tide_prompt_icon_connection '·'
|
||||
case 3
|
||||
case Solid
|
||||
set -g fake_tide_prompt_icon_connection '─'
|
||||
end
|
||||
switch $_tide_configure_style
|
||||
case lean
|
||||
_next_choice all/prompt_connection_andor_frame_color
|
||||
case classic rainbow
|
||||
_next_choice powerline/powerline_prompt_frame
|
||||
_next_choice powerline/powerline_right_prompt_frame
|
||||
end
|
||||
end
|
||||
|
@@ -10,26 +10,30 @@ function prompt_connection_andor_frame_color
|
||||
_tide_title "Connection & Frame Color"
|
||||
|
||||
_tide_option 1 Lightest
|
||||
_tide_display_prompt fake_tide_prompt_color_frame_and_connection 808080
|
||||
set -g fake_tide_prompt_color_frame_and_connection 808080
|
||||
_tide_display_prompt
|
||||
|
||||
_tide_option 2 Light
|
||||
_tide_display_prompt fake_tide_prompt_color_frame_and_connection 6C6C6C
|
||||
set -g fake_tide_prompt_color_frame_and_connection 6C6C6C
|
||||
_tide_display_prompt
|
||||
|
||||
_tide_option 3 Dark
|
||||
_tide_display_prompt fake_tide_prompt_color_frame_and_connection 585858
|
||||
set -g fake_tide_prompt_color_frame_and_connection 585858
|
||||
_tide_display_prompt
|
||||
|
||||
_tide_option 4 Darkest
|
||||
_tide_display_prompt fake_tide_prompt_color_frame_and_connection 444444
|
||||
set -g fake_tide_prompt_color_frame_and_connection 444444
|
||||
_tide_display_prompt
|
||||
|
||||
_tide_menu
|
||||
_tide_menu (status function)
|
||||
switch $_tide_selected_option
|
||||
case 1
|
||||
case Lightest
|
||||
set -g fake_tide_prompt_color_frame_and_connection 808080
|
||||
case 2
|
||||
case Light
|
||||
set -g fake_tide_prompt_color_frame_and_connection 6C6C6C
|
||||
case 3
|
||||
case Dark
|
||||
set -g fake_tide_prompt_color_frame_and_connection 585858
|
||||
case 4
|
||||
case Darkest
|
||||
set -g fake_tide_prompt_color_frame_and_connection 444444
|
||||
end
|
||||
_next_choice all/prompt_spacing
|
||||
|
@@ -2,19 +2,20 @@ function prompt_spacing
|
||||
_tide_title 'Prompt Spacing'
|
||||
|
||||
_tide_option 1 Compact
|
||||
set -g fake_tide_prompt_add_newline_before false
|
||||
_tide_display_prompt
|
||||
printf \e\[1A # Move cursor up 1 row
|
||||
_tide_display_prompt
|
||||
|
||||
_tide_option 2 Sparse
|
||||
set -g fake_tide_prompt_add_newline_before true
|
||||
_tide_display_prompt
|
||||
_tide_display_prompt
|
||||
|
||||
_tide_menu
|
||||
_tide_menu (status function)
|
||||
switch $_tide_selected_option
|
||||
case 1
|
||||
case Compact
|
||||
set -g fake_tide_prompt_add_newline_before false
|
||||
case 2
|
||||
case Sparse
|
||||
set -g fake_tide_prompt_add_newline_before true
|
||||
end
|
||||
_next_choice all/icons
|
||||
|
@@ -7,20 +7,22 @@ function show_time
|
||||
set -a fake_tide_right_prompt_items time
|
||||
|
||||
_tide_option 2 '24-hour format'
|
||||
_tide_display_prompt fake_tide_time_format %T
|
||||
set -g fake_tide_time_format %T
|
||||
_tide_display_prompt
|
||||
|
||||
_tide_option 3 '12-hour format'
|
||||
_tide_display_prompt fake_tide_time_format '%r'
|
||||
set -g fake_tide_time_format %r
|
||||
_tide_display_prompt
|
||||
|
||||
_tide_menu
|
||||
_tide_menu (status function)
|
||||
switch $_tide_selected_option
|
||||
case 1
|
||||
case No
|
||||
set -g fake_tide_time_format ''
|
||||
set -e fake_tide_right_prompt_items[-1]
|
||||
case 2
|
||||
case '24-hour format'
|
||||
set -g fake_tide_time_format %T
|
||||
case 3
|
||||
set -g fake_tide_time_format '%r'
|
||||
case '12-hour format'
|
||||
set -g fake_tide_time_format %r
|
||||
end
|
||||
switch $_tide_configure_style
|
||||
case lean
|
||||
|
@@ -1,4 +1,6 @@
|
||||
function style
|
||||
set -g _tide_configure_current_options
|
||||
|
||||
_tide_title 'Prompt Style'
|
||||
|
||||
_tide_option 1 Lean
|
||||
@@ -13,15 +15,15 @@ function style
|
||||
_load_config rainbow
|
||||
_tide_display_prompt
|
||||
|
||||
_tide_style_menu
|
||||
_tide_menu (status function) --no-restart
|
||||
switch $_tide_selected_option
|
||||
case 1
|
||||
case Lean
|
||||
_load_config lean
|
||||
set -g _tide_configure_style lean
|
||||
case 2
|
||||
case Classic
|
||||
_load_config classic
|
||||
set -g _tide_configure_style classic
|
||||
case 3
|
||||
case Rainbow
|
||||
_load_config rainbow
|
||||
set -g _tide_configure_style rainbow
|
||||
end
|
||||
@@ -29,29 +31,6 @@ function style
|
||||
end
|
||||
|
||||
function _load_config -a name
|
||||
string replace -r '^' 'set -g fake_' <(status dirname)/../../icons.fish | source
|
||||
string replace -r '^' 'set -g fake_' <(status dirname)/../../configs/$name.fish | source
|
||||
end
|
||||
|
||||
function _tide_style_menu # Exactly like _tide_menu except that it doesn't have (r) option
|
||||
set -l list_with_slashes (string join '/' $_tide_option_list)
|
||||
|
||||
echo '(q) Quit and do nothing'\n
|
||||
|
||||
while true
|
||||
set_color -o
|
||||
read --nchars 1 --prompt-str "Choice [$list_with_slashes/q] " input
|
||||
set_color normal
|
||||
|
||||
switch $input
|
||||
case q
|
||||
set -e _tide_selected_option # Skip through all the _next_choices
|
||||
set -e _tide_option_list
|
||||
command -q clear && clear
|
||||
break
|
||||
case $_tide_option_list
|
||||
set -e _tide_option_list
|
||||
set -g _tide_selected_option $input
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
22
functions/tide/configure/choices/all/transient.fish
Normal file
22
functions/tide/configure/choices/all/transient.fish
Normal file
@@ -0,0 +1,22 @@
|
||||
function transient
|
||||
_tide_title 'Enable transient prompt?'
|
||||
|
||||
_tide_option 1 No
|
||||
_tide_display_prompt
|
||||
_tide_display_prompt
|
||||
_tide_display_prompt
|
||||
|
||||
_tide_option 2 Yes
|
||||
_configure_transient= _tide_display_prompt
|
||||
_configure_transient= _tide_display_prompt
|
||||
_tide_display_prompt
|
||||
|
||||
_tide_menu (status function)
|
||||
switch $_tide_selected_option
|
||||
case No
|
||||
set fake_tide_prompt_transient_enabled false
|
||||
case Yes
|
||||
set fake_tide_prompt_transient_enabled true
|
||||
end
|
||||
_next_choice all/finish
|
||||
end
|
Reference in New Issue
Block a user