tide (fish prompt) installed
This commit is contained in:
parent
142fd7eaa4
commit
e83440486a
85 changed files with 2589 additions and 62 deletions
|
@ -0,0 +1,46 @@
|
|||
function finish
|
||||
_tide_title Finish
|
||||
|
||||
echo
|
||||
set_color red
|
||||
_tide_option y 'Overwrite your current tide config'
|
||||
set_color normal
|
||||
echo
|
||||
|
||||
_tide_option p 'Exit and print the config you just generated'
|
||||
echo
|
||||
|
||||
_tide_menu (status function)
|
||||
switch $_tide_selected_option
|
||||
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
|
||||
_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
|
||||
|
||||
# Set the real variables
|
||||
for fakeVar in (set --names | string match -r "^fake_tide.*")
|
||||
set -U (string replace 'fake_' '' $fakeVar) $$fakeVar
|
||||
end
|
||||
|
||||
# Make sure old prompt won't display
|
||||
set -e $_tide_prompt_var 2>/dev/null
|
||||
|
||||
# Re-initialize the prompt
|
||||
tide reload
|
||||
end
|
||||
|
||||
function _tide_print_configure_current_options
|
||||
_tide_fish_colorize "tide configure --auto $_tide_configure_current_options"
|
||||
end
|
33
.config/fish/functions/tide/configure/choices/all/icons.fish
Normal file
33
.config/fish/functions/tide/configure/choices/all/icons.fish
Normal file
|
@ -0,0 +1,33 @@
|
|||
function icons
|
||||
_tide_title Icons
|
||||
|
||||
_tide_option 1 'Few icons'
|
||||
_tide_display_prompt
|
||||
|
||||
_tide_option 2 'Many icons'
|
||||
_enable_icons
|
||||
_tide_display_prompt
|
||||
|
||||
_tide_menu (status function)
|
||||
switch $_tide_selected_option
|
||||
case 'Few icons'
|
||||
_disable_icons
|
||||
end
|
||||
_next_choice all/transient
|
||||
end
|
||||
|
||||
function _enable_icons
|
||||
set -p fake_tide_left_prompt_items os
|
||||
set -g fake_tide_pwd_icon
|
||||
set -g fake_tide_pwd_icon_home
|
||||
set -g fake_tide_cmd_duration_icon
|
||||
set -g fake_tide_git_icon
|
||||
end
|
||||
|
||||
function _disable_icons
|
||||
_tide_find_and_remove os fake_tide_left_prompt_items
|
||||
set fake_tide_pwd_icon
|
||||
set fake_tide_pwd_icon_home
|
||||
set fake_tide_cmd_duration_icon
|
||||
set fake_tide_git_icon
|
||||
end
|
|
@ -0,0 +1,26 @@
|
|||
function prompt_colors
|
||||
_tide_title 'Prompt Colors'
|
||||
|
||||
_tide_option 1 'True color'
|
||||
_tide_display_prompt
|
||||
|
||||
_tide_option 2 '16 colors'
|
||||
_load_config "$_tide_configure_style"_16color
|
||||
set -g _tide_16color true
|
||||
_tide_display_prompt
|
||||
|
||||
_tide_menu (status function)
|
||||
switch $_tide_selected_option
|
||||
case 'True color'
|
||||
_load_config "$_tide_configure_style"
|
||||
set -e _tide_16color
|
||||
switch $_tide_configure_style
|
||||
case lean rainbow
|
||||
_next_choice all/show_time
|
||||
case classic
|
||||
_next_choice classic/classic_prompt_color
|
||||
end
|
||||
case '16 colors'
|
||||
_next_choice all/show_time
|
||||
end
|
||||
end
|
|
@ -0,0 +1,31 @@
|
|||
function prompt_connection
|
||||
_tide_title 'Prompt Connection'
|
||||
|
||||
_tide_option 1 Disconnected
|
||||
set -g fake_tide_prompt_icon_connection ' '
|
||||
_tide_display_prompt
|
||||
|
||||
_tide_option 2 Dotted
|
||||
set -g fake_tide_prompt_icon_connection '·'
|
||||
_tide_display_prompt
|
||||
|
||||
_tide_option 3 Solid
|
||||
set -g fake_tide_prompt_icon_connection '─'
|
||||
_tide_display_prompt
|
||||
|
||||
_tide_menu (status function)
|
||||
switch $_tide_selected_option
|
||||
case Disconnected
|
||||
set -g fake_tide_prompt_icon_connection ' '
|
||||
case Dotted
|
||||
set -g fake_tide_prompt_icon_connection '·'
|
||||
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_right_prompt_frame
|
||||
end
|
||||
end
|
|
@ -0,0 +1,40 @@
|
|||
function prompt_connection_andor_frame_color
|
||||
if test "$_tide_16color" = true ||
|
||||
test "$fake_tide_left_prompt_frame_enabled" = false -a \
|
||||
"$fake_tide_right_prompt_frame_enabled" = false -a \
|
||||
"$fake_tide_prompt_icon_connection" = ' '
|
||||
_next_choice all/prompt_spacing
|
||||
return 0
|
||||
end
|
||||
|
||||
_tide_title "Connection & Frame Color"
|
||||
|
||||
_tide_option 1 Lightest
|
||||
set -g fake_tide_prompt_color_frame_and_connection 808080
|
||||
_tide_display_prompt
|
||||
|
||||
_tide_option 2 Light
|
||||
set -g fake_tide_prompt_color_frame_and_connection 6C6C6C
|
||||
_tide_display_prompt
|
||||
|
||||
_tide_option 3 Dark
|
||||
set -g fake_tide_prompt_color_frame_and_connection 585858
|
||||
_tide_display_prompt
|
||||
|
||||
_tide_option 4 Darkest
|
||||
set -g fake_tide_prompt_color_frame_and_connection 444444
|
||||
_tide_display_prompt
|
||||
|
||||
_tide_menu (status function)
|
||||
switch $_tide_selected_option
|
||||
case Lightest
|
||||
set -g fake_tide_prompt_color_frame_and_connection 808080
|
||||
case Light
|
||||
set -g fake_tide_prompt_color_frame_and_connection 6C6C6C
|
||||
case Dark
|
||||
set -g fake_tide_prompt_color_frame_and_connection 585858
|
||||
case Darkest
|
||||
set -g fake_tide_prompt_color_frame_and_connection 444444
|
||||
end
|
||||
_next_choice all/prompt_spacing
|
||||
end
|
|
@ -0,0 +1,22 @@
|
|||
function prompt_spacing
|
||||
_tide_title 'Prompt Spacing'
|
||||
|
||||
_tide_option 1 Compact
|
||||
set -g fake_tide_prompt_add_newline_before false
|
||||
_tide_display_prompt
|
||||
_tide_display_prompt
|
||||
|
||||
_tide_option 2 Sparse
|
||||
set -g fake_tide_prompt_add_newline_before true
|
||||
_tide_display_prompt
|
||||
_tide_display_prompt
|
||||
|
||||
_tide_menu (status function)
|
||||
switch $_tide_selected_option
|
||||
case Compact
|
||||
set -g fake_tide_prompt_add_newline_before false
|
||||
case Sparse
|
||||
set -g fake_tide_prompt_add_newline_before true
|
||||
end
|
||||
_next_choice all/icons
|
||||
end
|
|
@ -0,0 +1,33 @@
|
|||
function show_time
|
||||
_tide_title 'Show current time?'
|
||||
|
||||
_tide_option 1 No
|
||||
_tide_display_prompt
|
||||
|
||||
set -a fake_tide_right_prompt_items time
|
||||
|
||||
_tide_option 2 '24-hour format'
|
||||
set -g fake_tide_time_format %T
|
||||
_tide_display_prompt
|
||||
|
||||
_tide_option 3 '12-hour format'
|
||||
set -g fake_tide_time_format %r
|
||||
_tide_display_prompt
|
||||
|
||||
_tide_menu (status function)
|
||||
switch $_tide_selected_option
|
||||
case No
|
||||
set -g fake_tide_time_format ''
|
||||
set -e fake_tide_right_prompt_items[-1]
|
||||
case '24-hour format'
|
||||
set -g fake_tide_time_format %T
|
||||
case '12-hour format'
|
||||
set -g fake_tide_time_format %r
|
||||
end
|
||||
switch $_tide_configure_style
|
||||
case lean
|
||||
_next_choice "$_tide_configure_style"/"$_tide_configure_style"_prompt_height
|
||||
case classic rainbow
|
||||
_next_choice "$_tide_configure_style"/"$_tide_configure_style"_prompt_separators
|
||||
end
|
||||
end
|
36
.config/fish/functions/tide/configure/choices/all/style.fish
Normal file
36
.config/fish/functions/tide/configure/choices/all/style.fish
Normal file
|
@ -0,0 +1,36 @@
|
|||
function style
|
||||
set -g _tide_configure_current_options
|
||||
|
||||
_tide_title 'Prompt Style'
|
||||
|
||||
_tide_option 1 Lean
|
||||
_load_config lean
|
||||
_tide_display_prompt
|
||||
|
||||
_tide_option 2 Classic
|
||||
_load_config classic
|
||||
_tide_display_prompt
|
||||
|
||||
_tide_option 3 Rainbow
|
||||
_load_config rainbow
|
||||
_tide_display_prompt
|
||||
|
||||
_tide_menu (status function) --no-restart
|
||||
switch $_tide_selected_option
|
||||
case Lean
|
||||
_load_config lean
|
||||
set -g _tide_configure_style lean
|
||||
case Classic
|
||||
_load_config classic
|
||||
set -g _tide_configure_style classic
|
||||
case Rainbow
|
||||
_load_config rainbow
|
||||
set -g _tide_configure_style rainbow
|
||||
end
|
||||
_next_choice all/prompt_colors
|
||||
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
|
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue