Run new fish_indent on code

This commit is contained in:
Ilan Cosman 2021-03-02 09:46:40 -08:00
parent 2a888b96b4
commit 05af630a82
56 changed files with 194 additions and 195 deletions

View File

@ -1,9 +1,9 @@
complete -c tide --no-files
complete -c tide -x -n '__fish_use_subcommand' -a --help -d "Print help message"
complete -c tide -x -n '__fish_use_subcommand' -a --version -d "Print tide version"
complete -c tide -x -n '__fish_use_subcommand' -a bug-report -d "Print info for use in bug reports"
complete -c tide -x -n '__fish_use_subcommand' -a configure -d "Run the configuration wizard"
complete -c tide -x -n __fish_use_subcommand -a --help -d "Print help message"
complete -c tide -x -n __fish_use_subcommand -a --version -d "Print tide version"
complete -c tide -x -n __fish_use_subcommand -a bug-report -d "Print info for use in bug reports"
complete -c tide -x -n __fish_use_subcommand -a configure -d "Run the configuration wizard"
complete -c tide -x -n '__fish_seen_subcommand_from bug-report' -a --clean -d "Run clean Fish instance and install Tide"
complete -c tide -x -n '__fish_seen_subcommand_from bug-report' -a --verbose -d "Print full Tide configuration"
complete -c tide -x -n '__fish_seen_subcommand_from bug-report' -a --verbose -d "Print full Tide configuration"

View File

@ -20,7 +20,7 @@ function _tide_init_install --on-event _tide_init_install
source $_tide_root/functions/tide/configure/choices/all/style.fish
source $_tide_root/functions/tide/configure/choices/all/finish.fish
_load_config 'lean'
_load_config lean
_tide_finish
set -a _tide_var_list (set --names | string match --regex "^tide.*")

View File

@ -1,3 +1,3 @@
function _tide_cursor_right -a number
string repeat --count $number --no-newline \e\[1C
end
end

View File

@ -1,3 +1,3 @@
function _tide_cursor_up -a number
string repeat --count $number --no-newline \e\[1A
end
end

View File

@ -1,3 +1,3 @@
function _tide_decolor
string replace --all --regex '\e(\[[\d;]*|\(B\e\[)m(\co)?' '' "$argv"
end
end

View File

@ -6,9 +6,9 @@ function _tide_detect_os
set -gx _tide_os_icon
case linux
_tide_detect_os_linux_cases /etc/os-release ID ||
_tide_detect_os_linux_cases /etc/os-release ID_LIKE ||
_tide_detect_os_linux_cases /etc/lsb-release DISTRIB_ID ||
set -gx _tide_os_icon
_tide_detect_os_linux_cases /etc/os-release ID_LIKE ||
_tide_detect_os_linux_cases /etc/lsb-release DISTRIB_ID ||
set -gx _tide_os_icon
case '*'
set -gx _tide_os_icon '?'
end

View File

@ -16,4 +16,4 @@ function _tide_item_cmd_duration
printf '%s' $seconds's'
end
end
end
end

View File

@ -5,8 +5,8 @@ function _tide_item_context
else if contains -- $USER root toor Administrator
set_color $tide_context_root_color
printf '%s' $USER'@'$hostname
else if test "$tide_context_always_display" = 'true'
else if test "$tide_context_always_display" = true
set_color $tide_context_default_color
printf '%s' $USER'@'$hostname
end
end
end

View File

@ -51,7 +51,7 @@ function _tide_item_git
# Upstream behind/ahead
git rev-list --count --left-right @{upstream}...HEAD 2>/dev/null |
read --local --delimiter=\t upstreamBehind upstreamAhead
read --local --delimiter=\t upstreamBehind upstreamAhead
test "$upstreamBehind" = 0 && set -e upstreamBehind
test "$upstreamAhead" = 0 && set -e upstreamAhead

View File

@ -8,4 +8,4 @@ function _tide_item_jobs
printf '%s' $tide_jobs_icon
end
end
end
end

View File

@ -4,4 +4,4 @@ function _tide_item_nvm
set_color $tide_nvm_color
printf '%s' $tide_nvm_icon' ' $nvmCurrent
end
end
end

View File

@ -1,4 +1,4 @@
function _tide_item_os
set_color $tide_os_color
printf '%s' $_tide_os_icon
end
end

View File

@ -3,4 +3,4 @@ function _tide_item_php
set_color $tide_php_color
printf '%s' $tide_php_icon' ' (php --version | string match --regex 'PHP ([\d.]+)')[2]
end
end
end

View File

@ -5,7 +5,7 @@ function _tide_item_prompt_char
set_color $tide_prompt_char_failure_color
end
if test "$fish_key_bindings" = 'fish_default_key_bindings'
if test "$fish_key_bindings" = fish_default_key_bindings
printf '%s' $tide_prompt_char_icon' '
else
switch $fish_bind_mode

View File

@ -24,9 +24,9 @@ function _tide_item_pwd
set splitPwdForOutput[$i] $colorAnchors$splitPwd[$i]$keepBackgroundColor$colorDirs
else if test (string join -- '/' $splitPwdForLength | string length) -gt $pwdMaxLength
while set -l truncationLength (math $truncationLength + 1) &&
test $truncationLength -lt (string length -- $splitPwdForLength[$i]) &&
set -l truncated (string sub --length $truncationLength -- $splitPwd[$i]) &&
test (count $parentDir/$truncated*/) -gt 1
test $truncationLength -lt (string length -- $splitPwdForLength[$i]) &&
set -l truncated (string sub --length $truncationLength -- $splitPwd[$i]) &&
test (count $parentDir/$truncated*/) -gt 1
end
set splitPwdForLength[$i] $truncated
@ -43,7 +43,7 @@ function _tide_item_pwd
printf '%s' $colorDirs $tide_pwd_dir_icon' '
end
test "$splitPwd[1]" = '~' || printf '%s' '/'
test "$splitPwd[1]" = '~' || printf '%s' /
string join -- '/' $splitPwdForOutput
end
string join -- / $splitPwdForOutput
end

View File

@ -9,4 +9,4 @@ function _tide_item_rust
printf '%s' $tide_rust_icon' ' (rustc --version | string split ' ')[2]
end
end
end
end

View File

@ -1,10 +1,10 @@
function _tide_item_status
if string match --quiet --invert '0' $_tide_last_pipestatus # If there is a failure anywhere in the pipestatus
if test "$_tide_last_pipestatus" = '1' # If simple failure
if test "$tide_status_always_display" = 'true'
if string match --quiet --invert 0 $_tide_last_pipestatus # If there is a failure anywhere in the pipestatus
if test "$_tide_last_pipestatus" = 1 # If simple failure
if test "$tide_status_always_display" = true
set -g tide_status_bg_color $tide_status_failure_bg_color
set_color $tide_status_failure_color
printf '%s' $tide_status_failure_icon' ' '1'
printf '%s' $tide_status_failure_icon' ' 1
end
else
if test $_tide_last_pipestatus[-1] -eq 0
@ -17,11 +17,11 @@ function _tide_item_status
printf '%s' $tide_status_failure_icon' '
end
__fish_pipestatus_with_signal $_tide_last_pipestatus | string replace 'SIG' '' | string join '|'
__fish_pipestatus_with_signal $_tide_last_pipestatus | string replace SIG '' | string join '|'
end
else if test "$tide_status_always_display" = 'true'
else if test "$tide_status_always_display" = true
set -g tide_status_bg_color $tide_status_success_bg_color
set_color $tide_status_success_color
printf '%s' $tide_status_success_icon
end
end
end

View File

@ -1,4 +1,4 @@
function _tide_item_time
set_color $tide_time_color
date +$tide_time_format
end
end

View File

@ -1,5 +1,5 @@
function _tide_item_vi_mode
test "$fish_key_bindings" != 'fish_default_key_bindings' && switch $fish_bind_mode
test "$fish_key_bindings" != fish_default_key_bindings && switch $fish_bind_mode
case default
set -g tide_vi_mode_bg_color $tide_vi_mode_default_bg_color
set_color $tide_vi_mode_default_color
@ -17,4 +17,4 @@ function _tide_item_vi_mode
set_color $tide_vi_mode_visual_color
printf '%s' $tide_vi_mode_visual_icon
end
end
end

View File

@ -8,4 +8,4 @@ function _tide_item_virtual_env
printf '%s' $tide_virtual_env_icon' ' $splitVirtualEnv[-1]
end
end
end
end

View File

@ -2,7 +2,7 @@ function _tide_left_prompt
set lastItemWasNewline
for item in $tide_left_prompt_items
if test "$item" = 'newline'
if test "$item" = newline
set_color $previousColor -b normal
printf '%s' $tide_left_prompt_suffix\n
set lastItemWasNewline
@ -14,7 +14,7 @@ function _tide_left_prompt
set -l color $$colorName
if set -e lastItemWasNewline
if test "$tide_left_prompt_frame_enabled" = 'true'
if test "$tide_left_prompt_frame_enabled" = true
set_color $tide_left_prompt_frame_color -b normal
if set -q alreadyOneNewline
printf '%s' '╰─'
@ -23,7 +23,7 @@ function _tide_left_prompt
end
end
if test "$item" != 'prompt_char'
if test "$item" != prompt_char
set_color $color -b normal
printf '%s' $tide_left_prompt_prefix
end
@ -37,7 +37,7 @@ function _tide_left_prompt
set_color -b $color
if test "$tide_left_prompt_pad_items" = 'true' -a "$item" != 'prompt_char'
if test "$tide_left_prompt_pad_items" = true -a "$item" != prompt_char
printf '%s' " $output "
else
printf '%s' "$output"
@ -45,16 +45,16 @@ function _tide_left_prompt
set previousColor $color
test "$item" = 'prompt_char' && set lastItemWasPromptChar
test "$item" = prompt_char && set lastItemWasPromptChar
end
end
end
if set -q lastItemWasNewline && test "$tide_left_prompt_frame_enabled" = 'true'
if set -q lastItemWasNewline && test "$tide_left_prompt_frame_enabled" = true
set_color $tide_left_prompt_frame_color -b normal
printf '%s' '╰─'
else if not set -q lastItemWasPromptChar
set_color $previousColor -b normal
printf '%s' $tide_left_prompt_suffix
end
end
end

View File

@ -2,7 +2,7 @@ function _tide_prompt
# Variables are exported as strings, convert _tide_last_pipestatus back into a list
set -g _tide_last_pipestatus (string split ' ' $_tide_last_pipestatus)
test "$tide_print_newline_before_prompt" = 'true' && printf '%b' '\n'
test "$tide_print_newline_before_prompt" = true && printf '%b' '\n'
set_color $tide_prompt_connection_color
test -n "$tide_prompt_connection_icon" || set -l tide_prompt_connection_icon ' '

View File

@ -3,7 +3,7 @@ function _tide_right_prompt
set -l rightPromptHeight (count $splitText)
set -l leftPromptHeight (math 1+(string match --all 'newline' $tide_left_prompt_items | count))
if test "$tide_right_prompt_frame_enabled" = 'true'
if test "$tide_right_prompt_frame_enabled" = true
set -l frameColor (set_color $tide_right_prompt_frame_color -b normal || echo)
set splitText[1] $splitText[1]$frameColor'─╮'
@ -37,7 +37,7 @@ function _tide_fetch_right_prompt_items
set_color normal
for item in $tide_right_prompt_items
if test "$item" = 'newline'
if test "$item" = newline
set_color $previousColor -b normal
printf '%s' $tide_right_prompt_suffix\n
set lastItemWasNewline
@ -60,7 +60,7 @@ function _tide_fetch_right_prompt_items
set_color -b $color
if test "$tide_right_prompt_pad_items" = 'true'
if test "$tide_right_prompt_pad_items" = true
printf '%s' " $output "
else
printf '%s' "$output"
@ -82,4 +82,4 @@ function _tide_print_at_end -a text
_tide_cursor_right $startLocation
printf '%s%b' $text '\v\r' # For some reason \n doesn't work but \v\r does
end
end

View File

@ -1,5 +1,5 @@
function _tide_sub_bug-report
argparse 'c/clean' 'v/verbose' -- $argv
argparse c/clean v/verbose -- $argv
if set -q _flag_clean
HOME=(mktemp -d) fish --init-command "curl --silent \
@ -12,4 +12,4 @@ function _tide_sub_bug-report
tide --version
printf '%s\n' $TERM
end
end
end

View File

@ -19,7 +19,7 @@ function _tide_sub_configure
set -g fake_lines $LINES
set -g _tide_selected_option
_next_choice 'all/style'
_next_choice all/style
end
function _next_choice -a nextChoice
@ -60,7 +60,7 @@ function _tide_menu
switch $input
case r
set -e _tide_option_list
_next_choice 'all/style'
_next_choice all/style
break
case q
set -e _tide_selected_option # Skip through all the _next_choices

View File

@ -1 +1 @@
# Disables default vi prompt
# Disables default vi prompt

View File

@ -44,4 +44,3 @@ function __tide_on_fish_exit --on-event fish_exit
set -e _tide_left_prompt_display_$fish_pid
set -e _tide_right_prompt_display_$fish_pid
end

View File

@ -1,5 +1,5 @@
function tide
argparse --stop-nonopt 'v/version' 'h/help' -- $argv
argparse --stop-nonopt v/version h/help -- $argv
if set -q _flag_version
printf '%s\n' "tide, version 4.1.1"
@ -24,4 +24,4 @@ function _tide_help
'Subcommands:' \
' configure run interactive configuration wizard' \
' bug-report print info for use in bug reports'
end
end

View File

@ -3,7 +3,7 @@ function finish
_tide_title 'Overwrite tide config?'
set_color normal
_tide_option y 'Yes'
_tide_option y Yes
printf '%b' '\n'
_tide_menu
@ -40,17 +40,17 @@ function _tide_finish
end
# Deal with prompt char/vi mode
if contains 'prompt_char' $fake_tide_left_prompt_items
if contains prompt_char $fake_tide_left_prompt_items
_find_and_remove vi_mode fake_tide_right_prompt_items
else
set fake_tide_status_always_display true # Without a prompt_char, the user won't know if a command failed/succeeded
# If no prompt_char, insert vi_mode
_find_and_remove vi_mode fake_tide_right_prompt_items
if contains 'time' $fake_tide_right_prompt_items
set fake_tide_right_prompt_items $fake_tide_right_prompt_items[1..-2] 'vi_mode' $fake_tide_right_prompt_items[-1]
if contains time $fake_tide_right_prompt_items
set fake_tide_right_prompt_items $fake_tide_right_prompt_items[1..-2] vi_mode $fake_tide_right_prompt_items[-1]
else
set -a fake_tide_right_prompt_items 'vi_mode'
set -a fake_tide_right_prompt_items vi_mode
end
end

View File

@ -1,5 +1,5 @@
function icons
_tide_title 'Icons'
_tide_title Icons
_tide_option 1 'Few icons'
_tide_display_prompt
@ -13,7 +13,7 @@ function icons
case 1
_disable_icons
end
_next_choice 'all/finish'
_next_choice all/finish
end
function _enable_icons
@ -28,4 +28,4 @@ function _disable_icons
set fake_tide_pwd_dir_icon
set fake_tide_pwd_home_icon
set fake_tide_cmd_duration_icon
end
end

View File

@ -16,11 +16,11 @@ function prompt_colors
set -e _tide_16color
switch $_tide_configure_style
case lean rainbow
_next_choice 'all/show_time'
_next_choice all/show_time
case classic
_next_choice 'classic/classic_prompt_color'
_next_choice classic/classic_prompt_color
end
case 2
_next_choice 'all/show_time'
_next_choice all/show_time
end
end
end

View File

@ -1,13 +1,13 @@
function prompt_connection
_tide_title 'Prompt Connection'
_tide_option 1 'Disconnected'
_tide_option 1 Disconnected
_tide_display_prompt fake_tide_prompt_connection_icon ''
_tide_option 2 'Dotted'
_tide_option 2 Dotted
_tide_display_prompt fake_tide_prompt_connection_icon '·'
_tide_option 3 'Solid'
_tide_option 3 Solid
_tide_display_prompt fake_tide_prompt_connection_icon '─'
_tide_menu
@ -21,8 +21,8 @@ function prompt_connection
end
switch $_tide_configure_style
case lean
_next_choice 'all/prompt_connection_andor_frame_color'
_next_choice all/prompt_connection_andor_frame_color
case classic rainbow
_next_choice 'powerline/powerline_prompt_frame'
_next_choice powerline/powerline_prompt_frame
end
end
end

View File

@ -1,11 +1,11 @@
function prompt_connection_andor_frame_color
if test "$_tide_16color" = true
_next_choice 'all/prompt_spacing'
_next_choice all/prompt_spacing
return 0
end
test -n "$fake_tide_prompt_connection_icon" && set promptConnectionExists
test "$fake_tide_left_prompt_frame_enabled" = 'true' -o "$fake_tide_right_prompt_frame_enabled" = 'true' && set frameExists
test "$fake_tide_left_prompt_frame_enabled" = true -o "$fake_tide_right_prompt_frame_enabled" = true && set frameExists
if set -q promptConnectionExists && set -q frameExists
set title "Connection & Frame Color"
@ -14,25 +14,25 @@ function prompt_connection_andor_frame_color
else if set -q frameExists
set title "Frame Color"
else
_next_choice 'all/prompt_spacing'
_next_choice all/prompt_spacing
return 0
end
_tide_title $title
_tide_option 1 'Lightest'
_tide_option 1 Lightest
_set_prompt_connection_and_frame_color 808080
_tide_display_prompt
_tide_option 2 'Light'
_tide_option 2 Light
_set_prompt_connection_and_frame_color 6C6C6C
_tide_display_prompt
_tide_option 3 'Dark'
_tide_option 3 Dark
_set_prompt_connection_and_frame_color 585858
_tide_display_prompt
_tide_option 4 'Darkest'
_tide_option 4 Darkest
_set_prompt_connection_and_frame_color 444444
_tide_display_prompt
@ -47,11 +47,11 @@ function prompt_connection_andor_frame_color
case 4
_set_prompt_connection_and_frame_color 444444
end
_next_choice 'all/prompt_spacing'
_next_choice all/prompt_spacing
end
function _set_prompt_connection_and_frame_color -a color
set -g fake_tide_prompt_connection_color $color
set -g fake_tide_left_prompt_frame_color $color
set -g fake_tide_right_prompt_frame_color $color
end
end

View File

@ -1,12 +1,12 @@
function prompt_spacing
_tide_title 'Prompt Spacing'
_tide_option 1 'Compact'
_tide_option 1 Compact
_tide_display_prompt
_tide_cursor_up 1
_tide_display_prompt
_tide_option 2 'Sparse'
_tide_option 2 Sparse
_tide_display_prompt
_tide_display_prompt
@ -17,5 +17,5 @@ function prompt_spacing
case 2
set -g fake_tide_print_newline_before_prompt true
end
_next_choice 'all/icons'
end
_next_choice all/icons
end

View File

@ -1,10 +1,10 @@
function show_time
_tide_title 'Show current time?'
_tide_option 1 'No'
_tide_option 1 No
_tide_display_prompt
set -a fake_tide_right_prompt_items 'time'
set -a fake_tide_right_prompt_items time
_tide_option 2 '24-hour format'
_tide_display_prompt fake_tide_time_format '%T'
@ -28,4 +28,4 @@ function show_time
case classic rainbow
_next_choice "$_tide_configure_style"/"$_tide_configure_style"_prompt_separators
end
end
end

View File

@ -1,16 +1,16 @@
function style
_tide_title 'Prompt Style'
_tide_option 1 'Lean'
_load_config 'lean'
_tide_option 1 Lean
_load_config lean
_tide_display_prompt
_tide_option 2 'Classic'
_load_config 'classic'
_tide_option 2 Classic
_load_config classic
_tide_display_prompt
_tide_option 3 'Rainbow'
_load_config 'rainbow'
_tide_option 3 Rainbow
_load_config rainbow
_tide_display_prompt
_tide_menu
@ -25,9 +25,9 @@ function style
_load_config rainbow
set -g _tide_configure_style rainbow
end
_next_choice 'all/prompt_colors'
_next_choice all/prompt_colors
end
function _load_config -a name
printf '%s\n' "set -g fake_"(cat "$_tide_root/functions/tide/configure/configs/$name.fish") | source
end
end

View File

@ -1,19 +1,19 @@
function classic_prompt_color
_tide_title 'Prompt Color'
_tide_option 1 'Lightest'
_tide_option 1 Lightest
_set_all_items_bg_color 585858
_tide_display_prompt
_tide_option 2 'Light'
_tide_option 2 Light
_set_all_items_bg_color 444444
_tide_display_prompt
_tide_option 3 'Dark'
_tide_option 3 Dark
_set_all_items_bg_color 303030
_tide_display_prompt
_tide_option 4 'Darkest'
_tide_option 4 Darkest
_set_all_items_bg_color 1C1C1C
_tide_display_prompt
@ -28,5 +28,5 @@ function classic_prompt_color
case 4
_set_all_items_bg_color 1C1C1C
end
_next_choice 'all/show_time'
end
_next_choice all/show_time
end

View File

@ -1,22 +1,22 @@
function classic_prompt_separators
_tide_title 'Prompt Separators'
_tide_option 1 'Angled'
_tide_option 1 Angled
set -g fake_tide_left_prompt_item_separator_same_color ''
set -g fake_tide_right_prompt_item_separator_same_color ''
_tide_display_prompt
_tide_option 2 'Vertical'
_tide_option 2 Vertical
set -g fake_tide_left_prompt_item_separator_same_color '│'
set -g fake_tide_right_prompt_item_separator_same_color '│'
_tide_display_prompt
_tide_option 3 'Slanted'
_tide_option 3 Slanted
set -g fake_tide_left_prompt_item_separator_same_color ''
set -g fake_tide_right_prompt_item_separator_same_color ''
_tide_display_prompt
_tide_option 4 'Round'
_tide_option 4 Round
set -g fake_tide_left_prompt_item_separator_same_color ''
set -g fake_tide_right_prompt_item_separator_same_color ''
_tide_display_prompt
@ -36,5 +36,5 @@ function classic_prompt_separators
set -g fake_tide_left_prompt_item_separator_same_color ''
set -g fake_tide_right_prompt_item_separator_same_color ''
end
_next_choice 'powerline/powerline_prompt_heads'
end
_next_choice powerline/powerline_prompt_heads
end

View File

@ -2,21 +2,21 @@ function lean_prompt_height
_tide_title 'Prompt Height'
_tide_option 1 'One line'
_find_and_remove 'newline' fake_tide_left_prompt_items
_find_and_remove newline fake_tide_left_prompt_items
_tide_display_prompt
_tide_option 2 'Two lines'
set -g fake_tide_left_prompt_items $fake_tide_left_prompt_items[1..-2] 'newline' $fake_tide_left_prompt_items[-1]
set -g fake_tide_left_prompt_items $fake_tide_left_prompt_items[1..-2] newline $fake_tide_left_prompt_items[-1]
_tide_display_prompt
_tide_menu
switch $_tide_selected_option
case 1
_find_and_remove 'newline' fake_tide_left_prompt_items
_next_choice 'all/prompt_connection_andor_frame_color'
_find_and_remove newline fake_tide_left_prompt_items
_next_choice all/prompt_connection_andor_frame_color
case 2
_find_and_remove 'newline' fake_tide_left_prompt_items
set -g fake_tide_left_prompt_items $fake_tide_left_prompt_items[1..-2] 'newline' $fake_tide_left_prompt_items[-1]
_next_choice 'all/prompt_connection'
_find_and_remove newline fake_tide_left_prompt_items
set -g fake_tide_left_prompt_items $fake_tide_left_prompt_items[1..-2] newline $fake_tide_left_prompt_items[-1]
_next_choice all/prompt_connection
end
end
end

View File

@ -8,19 +8,19 @@ function powerline_prompt_frame
_tide_display_prompt
set -e fake_tide_left_prompt_items[-1]
_tide_option 2 'Left'
_tide_option 2 Left
set fake_tide_left_prompt_frame_enabled true
set fake_tide_right_prompt_frame_enabled false
_tide_display_prompt
_tide_option 3 'Right'
_tide_option 3 Right
set fake_tide_left_prompt_frame_enabled false
set fake_tide_right_prompt_frame_enabled true
set -a fake_tide_left_prompt_items prompt_char
_tide_display_prompt
set -e fake_tide_left_prompt_items[-1]
_tide_option 4 'Full'
_tide_option 4 Full
set fake_tide_left_prompt_frame_enabled true
set fake_tide_right_prompt_frame_enabled true
_tide_display_prompt
@ -42,5 +42,5 @@ function powerline_prompt_frame
set fake_tide_left_prompt_frame_enabled true
set fake_tide_right_prompt_frame_enabled true
end
_next_choice 'all/prompt_connection_andor_frame_color'
end
_next_choice all/prompt_connection_andor_frame_color
end

View File

@ -1,22 +1,22 @@
function powerline_prompt_heads
_tide_title 'Prompt Heads'
_tide_option 1 'Sharp'
_tide_option 1 Sharp
set -g fake_tide_left_prompt_suffix ''
set -g fake_tide_right_prompt_prefix ''
_tide_display_prompt
_tide_option 2 'Blurred'
_tide_option 2 Blurred
set -g fake_tide_left_prompt_suffix '▓▒░'
set -g fake_tide_right_prompt_prefix '░▒▓'
_tide_display_prompt
_tide_option 3 'Slanted'
_tide_option 3 Slanted
set -g fake_tide_left_prompt_suffix ''
set -g fake_tide_right_prompt_prefix ''
_tide_display_prompt
_tide_option 4 'Round'
_tide_option 4 Round
set -g fake_tide_left_prompt_suffix ''
set -g fake_tide_right_prompt_prefix ''
_tide_display_prompt
@ -36,5 +36,5 @@ function powerline_prompt_heads
set -g fake_tide_left_prompt_suffix ''
set -g fake_tide_right_prompt_prefix ''
end
_next_choice 'powerline/powerline_prompt_tails'
end
_next_choice powerline/powerline_prompt_tails
end

View File

@ -2,13 +2,13 @@ function powerline_prompt_height
_tide_title 'Prompt Height'
_tide_option 1 'One line'
_find_and_remove 'newline' fake_tide_left_prompt_items
_find_and_remove newline fake_tide_left_prompt_items
set fake_tide_left_prompt_frame_enabled false
set fake_tide_right_prompt_frame_enabled false
_tide_display_prompt
_tide_option 2 'Two lines'
set -g fake_tide_left_prompt_items $fake_tide_left_prompt_items 'newline'
set -g fake_tide_left_prompt_items $fake_tide_left_prompt_items newline
set fake_tide_left_prompt_frame_enabled true
set fake_tide_right_prompt_frame_enabled true
_tide_display_prompt
@ -16,15 +16,15 @@ function powerline_prompt_height
_tide_menu
switch $_tide_selected_option
case 1
_find_and_remove 'newline' fake_tide_left_prompt_items
_find_and_remove newline fake_tide_left_prompt_items
set fake_tide_left_prompt_frame_enabled false
set fake_tide_right_prompt_frame_enabled false
_next_choice 'all/prompt_connection_andor_frame_color'
_next_choice all/prompt_connection_andor_frame_color
case 2
_find_and_remove 'newline' fake_tide_left_prompt_items
set -g fake_tide_left_prompt_items $fake_tide_left_prompt_items 'newline'
_find_and_remove newline fake_tide_left_prompt_items
set -g fake_tide_left_prompt_items $fake_tide_left_prompt_items newline
set fake_tide_left_prompt_frame_enabled true
set fake_tide_right_prompt_frame_enabled true
_next_choice 'all/prompt_connection'
_next_choice all/prompt_connection
end
end
end

View File

@ -1,27 +1,27 @@
function powerline_prompt_tails
_tide_title 'Prompt Tails'
_tide_option 1 'Flat'
_tide_option 1 Flat
set -g fake_tide_left_prompt_prefix ''
set -g fake_tide_right_prompt_suffix ''
_tide_display_prompt
_tide_option 2 'Blurred'
_tide_option 2 Blurred
set -g fake_tide_left_prompt_prefix '░▒▓'
set -g fake_tide_right_prompt_suffix '▓▒░'
_tide_display_prompt
_tide_option 3 'Sharp'
_tide_option 3 Sharp
set -g fake_tide_left_prompt_prefix ''
set -g fake_tide_right_prompt_suffix ''
_tide_display_prompt
_tide_option 4 'Slanted'
_tide_option 4 Slanted
set -g fake_tide_left_prompt_prefix ''
set -g fake_tide_right_prompt_suffix ''
_tide_display_prompt
_tide_option 5 'Round'
_tide_option 5 Round
set -g fake_tide_left_prompt_prefix ''
set -g fake_tide_right_prompt_suffix ''
_tide_display_prompt
@ -44,5 +44,5 @@ function powerline_prompt_tails
set -g fake_tide_left_prompt_prefix ''
set -g fake_tide_right_prompt_suffix ''
end
_next_choice 'powerline/powerline_prompt_height'
end
_next_choice powerline/powerline_prompt_height
end

View File

@ -1,22 +1,22 @@
function rainbow_prompt_separators
_tide_title 'Prompt Separators'
_tide_option 1 'Angled'
_tide_option 1 Angled
set -g fake_tide_left_prompt_item_separator_diff_color ''
set -g fake_tide_right_prompt_item_separator_diff_color ''
_tide_display_prompt
_tide_option 2 'Vertical'
_tide_option 2 Vertical
set -g fake_tide_left_prompt_item_separator_diff_color ''
set -g fake_tide_right_prompt_item_separator_diff_color ''
_tide_display_prompt
_tide_option 3 'Slanted'
_tide_option 3 Slanted
set -g fake_tide_left_prompt_item_separator_diff_color ''
set -g fake_tide_right_prompt_item_separator_diff_color ''
_tide_display_prompt
_tide_option 4 'Round'
_tide_option 4 Round
set -g fake_tide_left_prompt_item_separator_diff_color ''
set -g fake_tide_right_prompt_item_separator_diff_color ''
_tide_display_prompt
@ -36,5 +36,5 @@ function rainbow_prompt_separators
set -g fake_tide_left_prompt_item_separator_diff_color ''
set -g fake_tide_right_prompt_item_separator_diff_color ''
end
_next_choice 'powerline/powerline_prompt_heads'
end
_next_choice powerline/powerline_prompt_heads
end

View File

@ -25,7 +25,7 @@ tide_left_prompt_frame_enabled true
tide_left_prompt_item_separator_diff_color ''
tide_left_prompt_item_separator_same_color ''
tide_left_prompt_item_separator_same_color_color 949494
tide_left_prompt_items 'pwd' 'git' 'newline'
tide_left_prompt_items pwd git newline
tide_left_prompt_pad_items true
tide_left_prompt_prefix ''
tide_left_prompt_suffix ''
@ -38,7 +38,7 @@ tide_os_color EEEEEE
tide_php_bg_color 444444
tide_php_color 875FFF
tide_php_icon ''
tide_print_newline_before_prompt 'true'
tide_print_newline_before_prompt true
tide_prompt_char_bg_color normal
tide_prompt_char_failure_color FF0000
tide_prompt_char_icon ''
@ -46,10 +46,10 @@ tide_prompt_char_success_color $_tide_color_green
tide_prompt_char_vi_default_icon ''
tide_prompt_char_vi_insert_icon ''
tide_prompt_char_vi_replace_icon '▶'
tide_prompt_char_vi_visual_icon 'V'
tide_prompt_char_vi_visual_icon V
tide_prompt_connection_color 6C6C6C
tide_prompt_connection_icon ''
tide_pwd_anchors 'first' 'last'
tide_pwd_anchors first last
tide_pwd_bg_color 444444
tide_pwd_color_anchors $_tide_color_light_blue
tide_pwd_color_dirs $_tide_color_dark_blue
@ -64,7 +64,7 @@ tide_right_prompt_frame_enabled true
tide_right_prompt_item_separator_diff_color ''
tide_right_prompt_item_separator_same_color ''
tide_right_prompt_item_separator_same_color_color 949494
tide_right_prompt_items 'status' 'cmd_duration' 'context' 'jobs' 'nvm' 'virtual_env' 'rust' 'php' 'vi_mode' 'chruby'
tide_right_prompt_items status cmd_duration context jobs nvm virtual_env rust php vi_mode chruby
tide_right_prompt_pad_items true
tide_right_prompt_prefix ''
tide_right_prompt_suffix ''
@ -99,5 +99,5 @@ tide_vi_mode_visual_color 5f87d7
tide_vi_mode_visual_icon VISUAL
tide_virtual_env_bg_color 444444
tide_virtual_env_color 00AFAF
tide_virtual_env_display_mode 'projectName'
tide_virtual_env_display_mode projectName
tide_virtual_env_icon ''

View File

@ -25,7 +25,7 @@ tide_left_prompt_frame_enabled false
tide_left_prompt_item_separator_diff_color ' '
tide_left_prompt_item_separator_same_color ' '
tide_left_prompt_item_separator_same_color_color 949494
tide_left_prompt_items 'pwd' 'git' 'newline' 'prompt_char'
tide_left_prompt_items pwd git newline prompt_char
tide_left_prompt_pad_items false
tide_left_prompt_prefix ''
tide_left_prompt_suffix ' '
@ -38,7 +38,7 @@ tide_os_color normal
tide_php_bg_color normal
tide_php_color 875FFF
tide_php_icon ''
tide_print_newline_before_prompt 'true'
tide_print_newline_before_prompt true
tide_prompt_char_bg_color normal
tide_prompt_char_failure_color FF0000
tide_prompt_char_icon ''
@ -46,10 +46,10 @@ tide_prompt_char_success_color $_tide_color_green
tide_prompt_char_vi_default_icon ''
tide_prompt_char_vi_insert_icon ''
tide_prompt_char_vi_replace_icon '▶'
tide_prompt_char_vi_visual_icon 'V'
tide_prompt_char_vi_visual_icon V
tide_prompt_connection_color 6C6C6C
tide_prompt_connection_icon ''
tide_pwd_anchors 'first' 'last'
tide_pwd_anchors first last
tide_pwd_bg_color normal
tide_pwd_color_anchors $_tide_color_light_blue
tide_pwd_color_dirs $_tide_color_dark_blue
@ -64,7 +64,7 @@ tide_right_prompt_frame_enabled false
tide_right_prompt_item_separator_diff_color ' '
tide_right_prompt_item_separator_same_color ' '
tide_right_prompt_item_separator_same_color_color 949494
tide_right_prompt_items 'status' 'cmd_duration' 'context' 'jobs' 'nvm' 'virtual_env' 'rust' 'php' 'chruby'
tide_right_prompt_items status cmd_duration context jobs nvm virtual_env rust php chruby
tide_right_prompt_pad_items false
tide_right_prompt_prefix ' '
tide_right_prompt_suffix ''
@ -99,5 +99,5 @@ tide_vi_mode_visual_color
tide_vi_mode_visual_icon
tide_virtual_env_bg_color normal
tide_virtual_env_color 00AFAF
tide_virtual_env_display_mode 'projectName'
tide_virtual_env_display_mode projectName
tide_virtual_env_icon ''

View File

@ -25,7 +25,7 @@ tide_left_prompt_frame_enabled true
tide_left_prompt_item_separator_diff_color ''
tide_left_prompt_item_separator_same_color ''
tide_left_prompt_item_separator_same_color_color 949494
tide_left_prompt_items 'pwd' 'git' 'newline'
tide_left_prompt_items pwd git newline
tide_left_prompt_pad_items true
tide_left_prompt_prefix ''
tide_left_prompt_suffix ''
@ -38,7 +38,7 @@ tide_os_color 080808
tide_php_bg_color 75507B
tide_php_color 000000
tide_php_icon ''
tide_print_newline_before_prompt 'true'
tide_print_newline_before_prompt true
tide_prompt_char_bg_color normal
tide_prompt_char_failure_color FF0000
tide_prompt_char_icon ''
@ -46,10 +46,10 @@ tide_prompt_char_success_color $_tide_color_green
tide_prompt_char_vi_default_icon ''
tide_prompt_char_vi_insert_icon ''
tide_prompt_char_vi_replace_icon '▶'
tide_prompt_char_vi_visual_icon 'V'
tide_prompt_char_vi_visual_icon V
tide_prompt_connection_color 6C6C6C
tide_prompt_connection_icon ''
tide_pwd_anchors 'first' 'last'
tide_pwd_anchors first last
tide_pwd_bg_color 3465A4
tide_pwd_color_anchors E4E4E4
tide_pwd_color_dirs E4E4E4
@ -64,7 +64,7 @@ tide_right_prompt_frame_enabled true
tide_right_prompt_item_separator_diff_color ''
tide_right_prompt_item_separator_same_color ''
tide_right_prompt_item_separator_same_color_color 949494
tide_right_prompt_items 'status' 'cmd_duration' 'context' 'jobs' 'nvm' 'virtual_env' 'rust' 'php' 'vi_mode' 'chruby'
tide_right_prompt_items status cmd_duration context jobs nvm virtual_env rust php vi_mode chruby
tide_right_prompt_pad_items true
tide_right_prompt_prefix ''
tide_right_prompt_suffix ''
@ -99,5 +99,5 @@ tide_vi_mode_visual_color 000000
tide_vi_mode_visual_icon VISUAL
tide_virtual_env_bg_color 444444
tide_virtual_env_color 00AFAF
tide_virtual_env_display_mode 'projectName'
tide_virtual_env_display_mode projectName
tide_virtual_env_icon ''

View File

@ -2,7 +2,7 @@ function _fake_tide_left_prompt
set lastItemWasNewline
for item in $fake_tide_left_prompt_items
if test "$item" = 'newline'
if test "$item" = newline
set_color $previousColor -b normal
printf '%s' $fake_tide_left_prompt_suffix\n
set lastItemWasNewline
@ -15,7 +15,7 @@ function _fake_tide_left_prompt
test -n "$color" || set color normal
if set -e lastItemWasNewline
if test "$fake_tide_left_prompt_frame_enabled" = 'true'
if test "$fake_tide_left_prompt_frame_enabled" = true
set_color $fake_tide_left_prompt_frame_color -b normal
if set -q alreadyOneNewline
printf '%s' '╰─'
@ -24,7 +24,7 @@ function _fake_tide_left_prompt
end
end
if test "$item" != 'prompt_char'
if test "$item" != prompt_char
set_color $color -b normal
printf '%s' $fake_tide_left_prompt_prefix
end
@ -40,7 +40,7 @@ function _fake_tide_left_prompt
set_color -b $color
if test "$fake_tide_left_prompt_pad_items" = 'true' -a "$item" != 'prompt_char'
if test "$fake_tide_left_prompt_pad_items" = true -a "$item" != prompt_char
printf '%s' " $output "
else
printf '%s' "$output"
@ -48,16 +48,16 @@ function _fake_tide_left_prompt
set previousColor $color
test "$item" = 'prompt_char' && set lastItemWasPromptChar
test "$item" = prompt_char && set lastItemWasPromptChar
end
end
end
if set -q lastItemWasNewline && test "$fake_tide_left_prompt_frame_enabled" = 'true'
if set -q lastItemWasNewline && test "$fake_tide_left_prompt_frame_enabled" = true
set_color $fake_tide_left_prompt_frame_color -b normal
printf '%s' '╰─'
else if not set -q lastItemWasPromptChar
set_color $previousColor -b normal
printf '%s' $fake_tide_left_prompt_suffix
end
end
end

View File

@ -3,7 +3,7 @@ function _fake_tide_right_prompt
set -l rightPromptHeight (count $splitText)
set -l leftPromptHeight (math 1+(string match --all 'newline' $fake_tide_left_prompt_items | count))
if test "$fake_tide_right_prompt_frame_enabled" = 'true'
if test "$fake_tide_right_prompt_frame_enabled" = true
set -l frameColor (set_color $fake_tide_right_prompt_frame_color -b normal || echo)
set splitText[1] $splitText[1]$frameColor'─╮'
@ -29,7 +29,7 @@ function _fake_tide_fetch_right_prompt_items
set_color normal
for item in $fake_tide_right_prompt_items
if test "$item" = 'newline'
if test "$item" = newline
set_color $previousColor -b normal
printf '%s' $fake_tide_right_prompt_suffix\n
set lastItemWasNewline
@ -55,7 +55,7 @@ function _fake_tide_fetch_right_prompt_items
set_color -b $color
if test "$fake_tide_right_prompt_pad_items" = 'true'
if test "$fake_tide_right_prompt_pad_items" = true
printf '%s' " $output "
else
printf '%s' "$output"
@ -77,4 +77,4 @@ function _fake_tide_print_at_end -a text
_tide_cursor_right $startLocation
printf '%s%b' $text '\v\r' # For some reason \n doesn't work but \v\r does
end
end

View File

@ -1,4 +1,4 @@
function _fake_tide_item_cmd_duration
set_color $fake_tide_cmd_duration_color
printf '%s' $fake_tide_cmd_duration_icon' ' '5s'
end
printf '%s' $fake_tide_cmd_duration_icon' ' 5s
end

View File

@ -1,4 +1,4 @@
function _fake_tide_item_git
set_color $fake_tide_git_branch_color
printf '%s' 'main'
end
printf '%s' main
end

View File

@ -1,4 +1,4 @@
function _fake_tide_item_os
set_color $fake_tide_os_color
printf '%s' $_tide_os_icon
end
end

View File

@ -1,4 +1,4 @@
function _fake_tide_item_prompt_char
set_color $fake_tide_prompt_char_success_color
printf '%s ' ''
end
end

View File

@ -7,14 +7,14 @@ function _fake_tide_item_pwd
set_color normal -b $fake_tide_pwd_bg_color
set_color $fake_tide_pwd_color_dirs
printf '%s' '/'
printf '%s' /
set_color normal -b $fake_tide_pwd_bg_color
set_color -o $fake_tide_pwd_color_anchors
printf '%s' 'src'
printf '%s' src
set_color normal -b $fake_tide_pwd_bg_color
else
set_color $fake_tide_pwd_color_dirs
printf '%s' '~/src'
end
end
end

View File

@ -1,4 +1,4 @@
function _fake_tide_item_time
set_color $fake_tide_time_color
printf '%s' (date +$fake_tide_time_format)
end
end

View File

@ -20,9 +20,9 @@ _pwd ~/unwritable/dir # CHECK:  ~/unwritable/dir
set -lx tide_pwd_unwritable_icon
_pwd '/' # CHECK: /
_pwd '/usr' # CHECK: /usr
_pwd '/usr/share' # CHECK: /usr/share
_pwd / # CHECK: /
_pwd /usr # CHECK: /usr
_pwd /usr/share # CHECK: /usr/share
# Normal directories