From 1b2fcb7f428cf6ae2b7a1505e7c2996e6f7d2ef7 Mon Sep 17 00:00:00 2001 From: Ilan Cosman Date: Mon, 18 May 2020 20:03:25 -0700 Subject: [PATCH] Rename to tide --- README.md | 10 +- conf.d/lean_count_left_prompt_height.fish | 4 - conf.d/tide_count_left_prompt_height.fish | 4 + ...ovement.fish => tide_cursor_movement.fish} | 0 dev/local_install.fish | 6 +- dev/{lean_test.fish => tide_test.fish} | 12 +-- functions/_lean_jobs.fish | 6 -- functions/_lean_time.fish | 4 - ..._duration.fish => _tide_cmd_duration.fish} | 8 +- ...{_lean_context.fish => _tide_context.fish} | 6 +- ..._git_prompt.fish => _tide_git_prompt.fish} | 2 +- functions/_tide_jobs.fish | 6 ++ ...{_lean_newline.fish => _tide_newline.fish} | 2 +- ...rompt_char.fish => _tide_prompt_char.fish} | 4 +- functions/{_lean_pwd.fish => _tide_pwd.fish} | 22 ++-- .../{_lean_status.fish => _tide_status.fish} | 10 +- functions/_tide_time.fish | 4 + functions/fish_prompt.fish | 12 +-- functions/lean.fish | 12 --- functions/tide.fish | 12 +++ .../{lean_decolor.fish => tide_decolor.fish} | 2 +- ...left_prompt.fish => tide_left_prompt.fish} | 4 +- ...ght_prompt.fish => tide_right_prompt.fish} | 14 +-- install.fish | 102 +++++++++--------- .../configure/functions/fake_prompt.fish | 15 --- .../prompt_items/_fake_lean_cmd_duration.fish | 4 - .../prompt_items/_fake_lean_git_prompt.fish | 4 - .../prompt_items/_fake_lean_newline.fish | 3 - .../prompt_items/_fake_lean_prompt_char.fish | 4 - .../prompt_items/_fake_lean_pwd.fish | 14 --- .../prompt_items/_fake_lean_time.fish | 4 - tests/cmd_duration.fish | 6 +- tests/context.fish | 6 +- tests/jobs.fish | 4 +- tests/pwd.fish | 4 +- tests/status.fish | 8 +- .../configure/choices/finish.fish | 10 +- .../configure/choices/prompt_connection.fish | 12 +-- .../choices/prompt_connection_color.fish | 16 +-- .../configure/choices/prompt_height.fish | 10 +- .../configure/choices/prompt_spacing.fish | 12 +-- .../configure/choices/show_time.fish | 12 +-- .../functions/fake_lean_left_prompt.fish | 4 +- .../functions/fake_lean_right_prompt.fish | 6 +- .../configure/functions/fake_prompt.fish | 15 +++ .../prompt_items/_fake_lean_cmd_duration.fish | 4 + .../prompt_items/_fake_lean_git_prompt.fish | 4 + .../prompt_items/_fake_lean_newline.fish | 3 + .../prompt_items/_fake_lean_prompt_char.fish | 4 + .../prompt_items/_fake_lean_pwd.fish | 14 +++ .../prompt_items/_fake_lean_time.fish | 4 + .../functions/configure.fish | 28 ++--- .../functions/help.fish | 12 +-- .../functions/uninstall.fish | 48 ++++----- 54 files changed, 281 insertions(+), 281 deletions(-) delete mode 100644 conf.d/lean_count_left_prompt_height.fish create mode 100644 conf.d/tide_count_left_prompt_height.fish rename conf.d/{lean_cursor_movement.fish => tide_cursor_movement.fish} (100%) rename dev/{lean_test.fish => tide_test.fish} (85%) delete mode 100644 functions/_lean_jobs.fish delete mode 100644 functions/_lean_time.fish rename functions/{_lean_cmd_duration.fish => _tide_cmd_duration.fish} (68%) rename functions/{_lean_context.fish => _tide_context.fish} (59%) rename functions/{_lean_git_prompt.fish => _tide_git_prompt.fish} (89%) create mode 100644 functions/_tide_jobs.fish rename functions/{_lean_newline.fish => _tide_newline.fish} (51%) rename functions/{_lean_prompt_char.fish => _tide_prompt_char.fish} (63%) rename functions/{_lean_pwd.fish => _tide_pwd.fish} (73%) rename functions/{_lean_status.fish => _tide_status.fish} (64%) create mode 100644 functions/_tide_time.fish delete mode 100644 functions/lean.fish create mode 100644 functions/tide.fish rename functions/{lean_decolor.fish => tide_decolor.fish} (83%) rename functions/{lean_left_prompt.fish => tide_left_prompt.fish} (59%) rename functions/{lean_right_prompt.fish => tide_right_prompt.fish} (68%) delete mode 100644 lean_theme/configure/functions/fake_prompt.fish delete mode 100644 lean_theme/configure/prompt_items/_fake_lean_cmd_duration.fish delete mode 100644 lean_theme/configure/prompt_items/_fake_lean_git_prompt.fish delete mode 100644 lean_theme/configure/prompt_items/_fake_lean_newline.fish delete mode 100644 lean_theme/configure/prompt_items/_fake_lean_prompt_char.fish delete mode 100644 lean_theme/configure/prompt_items/_fake_lean_pwd.fish delete mode 100644 lean_theme/configure/prompt_items/_fake_lean_time.fish rename {lean_theme => tide_theme}/configure/choices/finish.fish (69%) rename {lean_theme => tide_theme}/configure/choices/prompt_connection.fish (57%) rename {lean_theme => tide_theme}/configure/choices/prompt_connection_color.fish (52%) rename {lean_theme => tide_theme}/configure/choices/prompt_height.fish (61%) rename {lean_theme => tide_theme}/configure/choices/prompt_spacing.fish (59%) rename {lean_theme => tide_theme}/configure/choices/show_time.fish (62%) rename {lean_theme => tide_theme}/configure/functions/fake_lean_left_prompt.fish (54%) rename {lean_theme => tide_theme}/configure/functions/fake_lean_right_prompt.fish (75%) create mode 100644 tide_theme/configure/functions/fake_prompt.fish create mode 100644 tide_theme/configure/prompt_items/_fake_lean_cmd_duration.fish create mode 100644 tide_theme/configure/prompt_items/_fake_lean_git_prompt.fish create mode 100644 tide_theme/configure/prompt_items/_fake_lean_newline.fish create mode 100644 tide_theme/configure/prompt_items/_fake_lean_prompt_char.fish create mode 100644 tide_theme/configure/prompt_items/_fake_lean_pwd.fish create mode 100644 tide_theme/configure/prompt_items/_fake_lean_time.fish rename {lean_theme => tide_theme}/functions/configure.fish (70%) rename {lean_theme => tide_theme}/functions/help.fish (83%) rename {lean_theme => tide_theme}/functions/uninstall.fish (63%) diff --git a/README.md b/README.md index 9f53138..683ecb4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Lean +# Tide -A minimal Fish theme based on [Powerlevel10k](https://github.com/romkatv/powerlevel10k/)'s lean style. +A Fish theme based on [Powerlevel10k](https://github.com/romkatv/powerlevel10k/). ![Prompt_Connection](/media/images/Prompt_Connection.png) @@ -9,7 +9,7 @@ A minimal Fish theme based on [Powerlevel10k](https://github.com/romkatv/powerle Run the install script: ```fish -curl -s https://raw.githubusercontent.com/IlanCosman/lean/master/install.fish | source; and lean_install +curl -s https://raw.githubusercontent.com/IlanCosman/tide/master/install.fish | source; and tide_install ``` # Features @@ -30,7 +30,7 @@ curl -s https://raw.githubusercontent.com/IlanCosman/lean/master/install.fish | # Configuration -Note that all lean variables, unless stated otherwise, begin with the string `lean_`. Thus, for brevity, variables in this section will be denoted as `example_variable` but will actually be `lean_example_variable`. +Note that all tide variables, unless stated otherwise, begin with the string `tide_`. Thus, for brevity, variables in this section will be denoted as `example_variable` but will actually be `tide_example_variable`. ## Colors @@ -45,7 +45,7 @@ Note that all lean variables, unless stated otherwise, begin with the string `le ### git prompt -Lean's git capabilities are inherited from fish's built-in [fish_git_prompt](https://fishshell.com/docs/current/cmds/fish_git_prompt.html). Modify those variables to configure lean's git prompt. +Tide's git capabilities are inherited from fish's built-in [fish_git_prompt](https://fishshell.com/docs/current/cmds/fish_git_prompt.html). Modify those variables to configure tide's git prompt. ### prompt connection diff --git a/conf.d/lean_count_left_prompt_height.fish b/conf.d/lean_count_left_prompt_height.fish deleted file mode 100644 index d16631e..0000000 --- a/conf.d/lean_count_left_prompt_height.fish +++ /dev/null @@ -1,4 +0,0 @@ -function lean_count_left_prompt_height --on-variable lean_left_prompt_items - set -l numberOfNewlines (count (string match -a 'newline' $lean_left_prompt_items)) - set -U lean_left_prompt_height (math 1+$numberOfNewlines) -end \ No newline at end of file diff --git a/conf.d/tide_count_left_prompt_height.fish b/conf.d/tide_count_left_prompt_height.fish new file mode 100644 index 0000000..5a3f832 --- /dev/null +++ b/conf.d/tide_count_left_prompt_height.fish @@ -0,0 +1,4 @@ +function tide_count_left_prompt_height --on-variable tide_left_prompt_items + set -l numberOfNewlines (count (string match -a 'newline' $tide_left_prompt_items)) + set -U tide_left_prompt_height (math 1+$numberOfNewlines) +end \ No newline at end of file diff --git a/conf.d/lean_cursor_movement.fish b/conf.d/tide_cursor_movement.fish similarity index 100% rename from conf.d/lean_cursor_movement.fish rename to conf.d/tide_cursor_movement.fish diff --git a/dev/local_install.fish b/dev/local_install.fish index 3694794..4fc0d46 100644 --- a/dev/local_install.fish +++ b/dev/local_install.fish @@ -2,12 +2,12 @@ function local_install -a localRepo if source "$localRepo/install.fish" cp -r "$localRepo/conf.d" $__fish_config_dir cp -r "$localRepo/functions" $__fish_config_dir - cp -r "$localRepo/lean_theme" $__fish_config_dir + cp -r "$localRepo/tide_theme" $__fish_config_dir cp -r "$localRepo/tests" $__fish_config_dir cp -r "$localRepo/dev/." "$__fish_config_dir/functions" - _set_lean_defaults - _source_lean_functions + _set_tide_defaults + _source_tide_functions # Install fisher and fishtape for testing curl https://git.io/fisher --create-dirs -sLo ~/.config/fish/functions/fisher.fish diff --git a/dev/lean_test.fish b/dev/tide_test.fish similarity index 85% rename from dev/lean_test.fish rename to dev/tide_test.fish index eaaadc8..feacc5f 100644 --- a/dev/lean_test.fish +++ b/dev/tide_test.fish @@ -1,4 +1,4 @@ -function lean_test +function tide_test argparse 'h/help' 'v/verbose' 'a/all' -- $argv if set -q _flag_help @@ -8,9 +8,9 @@ function lean_test set -l testsDir "$__fish_config_dir/tests" - set -l pending '/tmp/lean_test' - set -l failed '/tmp/lean_test_failed' - set -l passed '/tmp/lean_test_passed' + set -l pending '/tmp/tide_test' + set -l failed '/tmp/tide_test_failed' + set -l passed '/tmp/tide_test_passed' if set -q _flag_all set argv (basename -s '.fish' $testsDir/*) @@ -48,7 +48,7 @@ end function _help set -l b (set_color -o) set -l n (set_color normal) - set -l g (set_color $lean_color_green) + set -l g (set_color $tide_color_green) set -l optionList \ 'v or --verbose' \ @@ -59,7 +59,7 @@ function _help 'run all available tests' \ 'print this help message' - echo 'Usage: '$g'lean_test '$n'[options] '$b'[TESTS...]'$n + echo 'Usage: '$g'tide_test '$n'[options] '$b'[TESTS...]'$n echo echo 'Options:' echo diff --git a/functions/_lean_jobs.fish b/functions/_lean_jobs.fish deleted file mode 100644 index 2aa6e2d..0000000 --- a/functions/_lean_jobs.fish +++ /dev/null @@ -1,6 +0,0 @@ -function _lean_jobs - if jobs -q - set_color $lean_jobs_color - printf '%s ' $lean_jobs_icon - end -end \ No newline at end of file diff --git a/functions/_lean_time.fish b/functions/_lean_time.fish deleted file mode 100644 index e1f9850..0000000 --- a/functions/_lean_time.fish +++ /dev/null @@ -1,4 +0,0 @@ -function _lean_time - set_color $lean_time_color - printf '%s ' (date +$lean_time_format) -end \ No newline at end of file diff --git a/functions/_lean_cmd_duration.fish b/functions/_tide_cmd_duration.fish similarity index 68% rename from functions/_lean_cmd_duration.fish rename to functions/_tide_cmd_duration.fish index d3f0ba7..9c60671 100644 --- a/functions/_lean_cmd_duration.fish +++ b/functions/_tide_cmd_duration.fish @@ -1,6 +1,6 @@ -function _lean_cmd_duration - if test $CMD_DURATION -gt $lean_cmd_duration_threshold - set -l seconds (math --scale=$lean_cmd_duration_decimals "$CMD_DURATION/1000" % 60) +function _tide_cmd_duration + if test $CMD_DURATION -gt $tide_cmd_duration_threshold + set -l seconds (math --scale=$tide_cmd_duration_decimals "$CMD_DURATION/1000" % 60) set -l minutes (math -s0 "$CMD_DURATION/60000" % 60) set -l hours (math -s0 "$CMD_DURATION/3600000" % 60) @@ -14,7 +14,7 @@ function _lean_cmd_duration set -e hours end - set_color $lean_cmd_duration_color + set_color $tide_cmd_duration_color printf '%s ' {$hours}'h' {$minutes}'m' {$seconds}'s' end end \ No newline at end of file diff --git a/functions/_lean_context.fish b/functions/_tide_context.fish similarity index 59% rename from functions/_lean_context.fish rename to functions/_tide_context.fish index 511d9a4..016c4ae 100644 --- a/functions/_lean_context.fish +++ b/functions/_tide_context.fish @@ -1,9 +1,9 @@ -function _lean_context +function _tide_context if set -q SSH_TTY - set_color $lean_context_ssh_color + set_color $tide_context_ssh_color printf '%s ' $USER'@'(prompt_hostname) else if test $USER = 'root' - set_color $lean_context_root_color + set_color $tide_context_root_color printf '%s ' $USER'@'(prompt_hostname) end end \ No newline at end of file diff --git a/functions/_lean_git_prompt.fish b/functions/_tide_git_prompt.fish similarity index 89% rename from functions/_lean_git_prompt.fish rename to functions/_tide_git_prompt.fish index f3023f6..a0c7a94 100644 --- a/functions/_lean_git_prompt.fish +++ b/functions/_tide_git_prompt.fish @@ -1,4 +1,4 @@ -function _lean_git_prompt +function _tide_git_prompt if set -l gitPrompt (fish_git_prompt) set -l gitPrompt (string replace '(' '' $gitPrompt) diff --git a/functions/_tide_jobs.fish b/functions/_tide_jobs.fish new file mode 100644 index 0000000..f45e42f --- /dev/null +++ b/functions/_tide_jobs.fish @@ -0,0 +1,6 @@ +function _tide_jobs + if jobs -q + set_color $tide_jobs_color + printf '%s ' $tide_jobs_icon + end +end \ No newline at end of file diff --git a/functions/_lean_newline.fish b/functions/_tide_newline.fish similarity index 51% rename from functions/_lean_newline.fish rename to functions/_tide_newline.fish index e7d06d5..12c3fde 100644 --- a/functions/_lean_newline.fish +++ b/functions/_tide_newline.fish @@ -1,3 +1,3 @@ -function _lean_newline +function _tide_newline printf '%s' '\n' end \ No newline at end of file diff --git a/functions/_lean_prompt_char.fish b/functions/_tide_prompt_char.fish similarity index 63% rename from functions/_lean_prompt_char.fish rename to functions/_tide_prompt_char.fish index 912762b..1b28d9e 100644 --- a/functions/_lean_prompt_char.fish +++ b/functions/_tide_prompt_char.fish @@ -1,6 +1,6 @@ -function _lean_prompt_char +function _tide_prompt_char if test $last_status -eq 0 - set_color $lean_color_green + set_color $tide_color_green else set_color $fish_color_error end diff --git a/functions/_lean_pwd.fish b/functions/_tide_pwd.fish similarity index 73% rename from functions/_lean_pwd.fish rename to functions/_tide_pwd.fish index c90d937..83398ce 100644 --- a/functions/_lean_pwd.fish +++ b/functions/_tide_pwd.fish @@ -1,37 +1,37 @@ -function _lean_pwd +function _tide_pwd set -l splitPwd (string split --no-empty '/' (_shorten_pwd)) set -l splitPwdLength (count $splitPwd) if not test -w $PWD - set_color $lean_color_dark_blue - printf '%s' {$lean_pwd_unwritable_icon}' ' + set_color $tide_color_dark_blue + printf '%s' {$tide_pwd_unwritable_icon}' ' set_color $fish_color_normal end if test "$splitPwd[1]" != '~' - set_color $lean_color_dark_blue + set_color $tide_color_dark_blue printf '%s' '/' set_color $fish_color_normal end - set_color -o $lean_color_light_blue + set_color -o $tide_color_light_blue printf '%s' "$splitPwd[1]" set_color $fish_color_normal if test $splitPwdLength -gt 1 - set_color $lean_color_dark_blue + set_color $tide_color_dark_blue printf '%s' '/' set_color $fish_color_normal end if test $splitPwdLength -gt 2 - set_color $lean_color_dark_blue + set_color $tide_color_dark_blue printf '%s' (string join '/' $splitPwd[2..-2])'/' set_color $fish_color_normal end if test $splitPwdLength -gt 1 - set_color -o $lean_color_light_blue + set_color -o $tide_color_light_blue printf '%s' "$splitPwd[-1]" set_color $fish_color_normal end @@ -43,7 +43,7 @@ function _shorten_pwd set -l pwd (string replace $HOME '~' $PWD) set -l colorPwd $pwd set -l splitPwd (string split --no-empty '/' $pwd) - set -l targetLength (math $COLUMNS-$lean_pwd_shorten_margin) + set -l targetLength (math $COLUMNS-$tide_pwd_shorten_margin) set -l index 2 while test (string length $pwd) -gt $targetLength @@ -51,8 +51,8 @@ function _shorten_pwd set -l currentPartFirstLetter (string sub -l 1 $currentPart) set pwd (string replace $currentPart $currentPartFirstLetter $pwd) - set -l lilac (set_color $lean_color_lilac) - set -l dBlue (set_color $lean_color_dark_blue) + set -l lilac (set_color $tide_color_lilac) + set -l dBlue (set_color $tide_color_dark_blue) set colorPwd (string replace $currentPart "$lilac"$currentPartFirstLetter"$dBlue" $colorPwd) set index (math $index+1) diff --git a/functions/_lean_status.fish b/functions/_tide_status.fish similarity index 64% rename from functions/_lean_status.fish rename to functions/_tide_status.fish index 8836249..96c2808 100644 --- a/functions/_lean_status.fish +++ b/functions/_tide_status.fish @@ -1,14 +1,14 @@ -function _lean_status +function _tide_status if string match -q --invert '0' $last_pipestatus set -l fishPipestatusWithSignal (__fish_pipestatus_with_signal $last_pipestatus) if test (count $last_pipestatus) -gt 1 || string match -qe 'SIG' $fishPipestatusWithSignal if test $last_status -eq 0 - set_color $lean_status_success_color - printf '%s ' {$lean_status_success_icon} + set_color $tide_status_success_color + printf '%s ' {$tide_status_success_icon} else - set_color $lean_status_failure_color - printf '%s ' {$lean_status_failure_icon} + set_color $tide_status_failure_color + printf '%s ' {$tide_status_failure_icon} end printf '%s ' (string join '|' (string replace 'SIG' '' $fishPipestatusWithSignal)) end diff --git a/functions/_tide_time.fish b/functions/_tide_time.fish new file mode 100644 index 0000000..9ac8916 --- /dev/null +++ b/functions/_tide_time.fish @@ -0,0 +1,4 @@ +function _tide_time + set_color $tide_time_color + printf '%s ' (date +$tide_time_format) +end \ No newline at end of file diff --git a/functions/fish_prompt.fish b/functions/fish_prompt.fish index 9d4dfe0..96a087c 100644 --- a/functions/fish_prompt.fish +++ b/functions/fish_prompt.fish @@ -1,19 +1,19 @@ -# Created by lean configure +# Created by tide configure function fish_prompt --description 'Write out the prompt' set -g last_pipestatus $pipestatus set -g last_status $status - if test "$lean_newline" = 'true' + if test "$tide_newline" = 'true' printf '%b' '\n' end - set_color $lean_prompt_connection_color - printf "%.s$lean_prompt_connection_icon" (seq $COLUMNS) + set_color $tide_prompt_connection_color + printf "%.s$tide_prompt_connection_icon" (seq $COLUMNS) set_color $fish_color_normal printf '%b' '\r' - lean_right_prompt + tide_right_prompt printf '%b' '\r' - lean_left_prompt + tide_left_prompt end diff --git a/functions/lean.fish b/functions/lean.fish deleted file mode 100644 index 8acb4be..0000000 --- a/functions/lean.fish +++ /dev/null @@ -1,12 +0,0 @@ -function lean -a subcommand - set -l leanSubcommand "lean_$subcommand" - set -l leanCommands 'configure' 'uninstall' 'help' - - if contains $subcommand $leanCommands - source "$lean_dir/functions/$subcommand.fish" - $leanSubcommand $argv[2..-1] - else - lean help - end - functions -e $leanSubcommand -end \ No newline at end of file diff --git a/functions/tide.fish b/functions/tide.fish new file mode 100644 index 0000000..17a88a3 --- /dev/null +++ b/functions/tide.fish @@ -0,0 +1,12 @@ +function tide -a subcommand + set -l tideSubcommand "tide_$subcommand" + set -l tideCommands 'configure' 'uninstall' 'help' + + if contains $subcommand $tideCommands + source "$tide_dir/functions/$subcommand.fish" + $tideSubcommand $argv[2..-1] + else + tide help + end + functions -e $tideSubcommand +end \ No newline at end of file diff --git a/functions/lean_decolor.fish b/functions/tide_decolor.fish similarity index 83% rename from functions/lean_decolor.fish rename to functions/tide_decolor.fish index 35bd9d2..bfddd6b 100644 --- a/functions/lean_decolor.fish +++ b/functions/tide_decolor.fish @@ -1,4 +1,4 @@ -function lean_decolor -a text +function tide_decolor -a text set text (string replace -a (set_color normal) '' "$text") set text (string replace -ar '\e\[[0-9;]*m' '' "$text") diff --git a/functions/lean_left_prompt.fish b/functions/tide_left_prompt.fish similarity index 59% rename from functions/lean_left_prompt.fish rename to functions/tide_left_prompt.fish index aadf4ad..774885f 100644 --- a/functions/lean_left_prompt.fish +++ b/functions/tide_left_prompt.fish @@ -1,5 +1,5 @@ -function lean_left_prompt - for item in lean_{$lean_left_prompt_items} +function tide_left_prompt + for item in tide_{$tide_left_prompt_items} set -l itemOutput (_$item) printf '%b' "$itemOutput" diff --git a/functions/lean_right_prompt.fish b/functions/tide_right_prompt.fish similarity index 68% rename from functions/lean_right_prompt.fish rename to functions/tide_right_prompt.fish index 122282e..1d01604 100644 --- a/functions/lean_right_prompt.fish +++ b/functions/tide_right_prompt.fish @@ -1,29 +1,29 @@ -function lean_right_prompt +function tide_right_prompt set -l splitText (string split '\n' (_fetch_right_prompt_items)) set -l printAtEndedRightPromptHeight (count $splitText) for thing in $splitText[1..-2] _print_at_end $thing end - if test $printAtEndedRightPromptHeight -eq $lean_left_prompt_height - set -g lean_right_prompt_fish $splitText[-1] + if test $printAtEndedRightPromptHeight -eq $tide_left_prompt_height + set -g tide_right_prompt_fish $splitText[-1] set printAtEndedRightPromptHeight (math $printAtEndedRightPromptHeight-1) else _print_at_end $splitText[-1] - set -g lean_right_prompt_fish '' + set -g tide_right_prompt_fish '' end _cursor_up $printAtEndedRightPromptHeight end function fish_right_prompt - printf '%s' $lean_right_prompt_fish + printf '%s' $tide_right_prompt_fish end function _fetch_right_prompt_items printf '%s' ' ' - for item in lean_{$lean_right_prompt_items} + for item in tide_{$tide_right_prompt_items} set -l itemOutput (_$item) printf '%s' "$itemOutput" @@ -32,7 +32,7 @@ function _fetch_right_prompt_items end function _print_at_end -a text - set -l startLocation (math $COLUMNS -(string length (lean_decolor $text))) + set -l startLocation (math $COLUMNS -(string length (tide_decolor $text))) _cursor_right $startLocation printf '%s' $text diff --git a/install.fish b/install.fish index dde95c6..7282f5f 100644 --- a/install.fish +++ b/install.fish @@ -1,17 +1,17 @@ -function lean_install - echo 'Installing lean theme...' +function tide_install + echo 'Installing tide theme...' # -----------------Download Functions----------------- - set -l tempDir '/tmp/lean_theme' + set -l tempDir '/tmp/tide_theme' # Clone repository into $tempDir if test -e $tempDir rm -rf $tempDir end - git clone -q --depth=1 https://github.com/IlanCosman/lean.git $tempDir + git clone -q --depth=1 https://github.com/IlanCosman/tide.git $tempDir - # Remove all files/dirs except functions and lean_theme - set -l keepFiles "$tempDir/"{'conf.d', 'functions', 'lean_theme'} + # Remove all files/dirs except functions and tide_theme + set -l keepFiles "$tempDir/"{'conf.d', 'functions', 'tide_theme'} for file in $tempDir/* if not contains $file $keepFiles rm -rf $file @@ -19,54 +19,54 @@ function lean_install end rm -rf "$tempDir/.git" - # Copy remaining directory contents into $__fish_config_dir and cleanup + # Copy remaining directory contents into $__fish_config_dir and ctideup cp -rf "$tempDir/." $__fish_config_dir rm -rf $tempDir # --------------------Set Defaults-------------------- - _set_lean_defaults + _set_tide_defaults # -----------------------Finish----------------------- - _source_lean_functions + _source_tide_functions - set_color $lean_color_green - echo 'Lean theme installed!' + set_color $tide_color_green + echo 'Tide theme installed!' set_color $fish_color_normal - if _user_confirm_defaultYes 'Configure lean prompt?' - lean configure + if _user_confirm_defaultYes 'Configure tide prompt?' + tide configure else echo - echo 'Run lean configure to configure your prompt.' + echo 'Run tide configure to configure your prompt.' end end -function _set_lean_defaults +function _set_tide_defaults # ---------------General Theme Variables--------------- - set -U lean_dir "$__fish_config_dir/lean_theme" - set -U lean_newline 'true' + set -U tide_dir "$__fish_config_dir/tide_theme" + set -U tide_newline 'true' # --------------Colors-------------- - set -U lean_color_green 5FD700 - set -U lean_color_light_blue 00AFFF - set -U lean_color_dark_blue 0087AF - set -U lean_color_gold D7AF00 - set -U lean_color_lilac 8787AF + set -U tide_color_green 5FD700 + set -U tide_color_light_blue 00AFFF + set -U tide_color_dark_blue 0087AF + set -U tide_color_gold D7AF00 + set -U tide_color_lilac 8787AF # ---------Prompt Connection--------- - set -U lean_prompt_connection_color 6C6C6C - set -U lean_prompt_connection_icon ' ' + set -U tide_prompt_connection_color 6C6C6C + set -U tide_prompt_connection_icon ' ' # --------------------Prompt Items-------------------- - set -U lean_left_prompt_items 'pwd' 'git_prompt' 'newline' 'prompt_char' - set -U lean_right_prompt_items 'status' 'cmd_duration' 'context' 'jobs' + set -U tide_left_prompt_items 'pwd' 'git_prompt' 'newline' 'prompt_char' + set -U tide_right_prompt_items 'status' 'cmd_duration' 'context' 'jobs' # ----------------Pwd---------------- - set -U lean_pwd_shorten_margin 5 - set -U lean_pwd_unwritable_icon '' # Lock + set -U tide_pwd_shorten_margin 5 + set -U tide_pwd_unwritable_icon '' # Lock # ------------Git prompt------------ set -U __fish_git_prompt_show_informative_status true set -U __fish_git_prompt_showstashstate true # -------Symbols------- set -U __fish_git_prompt_char_stateseparator '' - set -U __fish_git_prompt_char_cleanstate '' + set -U __fish_git_prompt_char_ctidestate '' set -U __fish_git_prompt_char_upstream_ahead ' ⇡' set -U __fish_git_prompt_char_upstream_behind ' ⇣' set -U __fish_git_prompt_char_stagedstate ' +' @@ -74,37 +74,37 @@ function _set_lean_defaults set -U __fish_git_prompt_char_untrackedfiles ' ?' set -U __fish_git_prompt_char_stashstate ' *' # --------Colors-------- - set -U __fish_git_prompt_color_branch $lean_color_green - set -U __fish_git_prompt_color_upstream $lean_color_green - set -U __fish_git_prompt_color_stagedstate $lean_color_gold - set -U __fish_git_prompt_color_dirtystate $lean_color_gold - set -U __fish_git_prompt_color_untrackedfiles $lean_color_light_blue - set -U __fish_git_prompt_color_stashstate $lean_color_green + set -U __fish_git_prompt_color_branch $tide_color_green + set -U __fish_git_prompt_color_upstream $tide_color_green + set -U __fish_git_prompt_color_stagedstate $tide_color_gold + set -U __fish_git_prompt_color_dirtystate $tide_color_gold + set -U __fish_git_prompt_color_untrackedfiles $tide_color_light_blue + set -U __fish_git_prompt_color_stashstate $tide_color_green # --------------Status-------------- - set -U lean_status_success_icon '✔' - set -U lean_status_success_color 5FAF00 - set -U lean_status_failure_icon '✘' - set -U lean_status_failure_color D70000 + set -U tide_status_success_icon '✔' + set -U tide_status_success_color 5FAF00 + set -U tide_status_failure_icon '✘' + set -U tide_status_failure_color D70000 # -----------Cmd_Duration----------- - set -U lean_cmd_duration_color 87875F - set -U lean_cmd_duration_decimals 0 - set -U lean_cmd_duration_threshold 3000 + set -U tide_cmd_duration_color 87875F + set -U tide_cmd_duration_decimals 0 + set -U tide_cmd_duration_threshold 3000 # --------------Context-------------- - set -U lean_context_ssh_color D7AF87 - set -U lean_context_root_color D7AF00 + set -U tide_context_ssh_color D7AF87 + set -U tide_context_root_color D7AF00 # ---------------Jobs--------------- - set -U lean_jobs_icon '' # Gear - set -U lean_jobs_color 5FAF00 + set -U tide_jobs_icon '' # Gear + set -U tide_jobs_color 5FAF00 # ---------------Time--------------- - set -U lean_time_color 5F8787 + set -U tide_time_color 5F8787 end -function _source_lean_functions - source "$__fish_config_dir/conf.d/lean_count_left_prompt_height.fish" - source "$__fish_config_dir/conf.d/lean_cursor_movement.fish" +function _source_tide_functions + source "$__fish_config_dir/conf.d/tide_count_left_prompt_height.fish" + source "$__fish_config_dir/conf.d/tide_cursor_movement.fish" source "$__fish_config_dir/functions/fish_prompt.fish" - lean_count_left_prompt_height + tide_count_left_prompt_height end function _user_confirm_defaultYes -a question diff --git a/lean_theme/configure/functions/fake_prompt.fish b/lean_theme/configure/functions/fake_prompt.fish deleted file mode 100644 index 9102716..0000000 --- a/lean_theme/configure/functions/fake_prompt.fish +++ /dev/null @@ -1,15 +0,0 @@ -function fake_prompt - if test "$fake_lean_newline" = 'true' - printf '\n' - end - - set_color $fake_lean_prompt_connection_color - printf "%.s$fake_lean_prompt_connection_icon" (seq $fake_columns) - set_color $fish_color_normal - - printf '\r' - fake_lean_right_prompt - - printf '\r' - fake_lean_left_prompt -end \ No newline at end of file diff --git a/lean_theme/configure/prompt_items/_fake_lean_cmd_duration.fish b/lean_theme/configure/prompt_items/_fake_lean_cmd_duration.fish deleted file mode 100644 index 22ca598..0000000 --- a/lean_theme/configure/prompt_items/_fake_lean_cmd_duration.fish +++ /dev/null @@ -1,4 +0,0 @@ -function _fake_lean_cmd_duration - set_color $lean_cmd_duration_color - printf '%s ' '5s' -end \ No newline at end of file diff --git a/lean_theme/configure/prompt_items/_fake_lean_git_prompt.fish b/lean_theme/configure/prompt_items/_fake_lean_git_prompt.fish deleted file mode 100644 index d5b23ba..0000000 --- a/lean_theme/configure/prompt_items/_fake_lean_git_prompt.fish +++ /dev/null @@ -1,4 +0,0 @@ -function _fake_lean_git_prompt - set_color $lean_color_green - printf '%s ' 'master' -end \ No newline at end of file diff --git a/lean_theme/configure/prompt_items/_fake_lean_newline.fish b/lean_theme/configure/prompt_items/_fake_lean_newline.fish deleted file mode 100644 index 57ce9a0..0000000 --- a/lean_theme/configure/prompt_items/_fake_lean_newline.fish +++ /dev/null @@ -1,3 +0,0 @@ -function _fake_lean_newline - printf '%s' '\n' -end \ No newline at end of file diff --git a/lean_theme/configure/prompt_items/_fake_lean_prompt_char.fish b/lean_theme/configure/prompt_items/_fake_lean_prompt_char.fish deleted file mode 100644 index d4e058e..0000000 --- a/lean_theme/configure/prompt_items/_fake_lean_prompt_char.fish +++ /dev/null @@ -1,4 +0,0 @@ -function _fake_lean_prompt_char - set_color $lean_color_green - printf '%s ' '❯' -end \ No newline at end of file diff --git a/lean_theme/configure/prompt_items/_fake_lean_pwd.fish b/lean_theme/configure/prompt_items/_fake_lean_pwd.fish deleted file mode 100644 index 631fcc0..0000000 --- a/lean_theme/configure/prompt_items/_fake_lean_pwd.fish +++ /dev/null @@ -1,14 +0,0 @@ -function _fake_lean_pwd - set_color -o $lean_color_light_blue - printf '%s' '~' - set_color normal - - set_color $lean_color_dark_blue - printf '%s' '/' - set_color normal - - set_color -o $lean_color_light_blue - printf '%s' 'src' - - printf '%s' ' ' -end \ No newline at end of file diff --git a/lean_theme/configure/prompt_items/_fake_lean_time.fish b/lean_theme/configure/prompt_items/_fake_lean_time.fish deleted file mode 100644 index a2f5d88..0000000 --- a/lean_theme/configure/prompt_items/_fake_lean_time.fish +++ /dev/null @@ -1,4 +0,0 @@ -function _fake_lean_time - set_color $fake_lean_time_color - printf '%s ' (date +$fake_lean_time_format) -end \ No newline at end of file diff --git a/tests/cmd_duration.fish b/tests/cmd_duration.fish index 23b8389..acc354a 100644 --- a/tests/cmd_duration.fish +++ b/tests/cmd_duration.fish @@ -2,10 +2,10 @@ function _cmd_duration -a duration threshold decimals set -g CMD_DURATION $duration - set -g lean_cmd_duration_threshold $threshold - set -g lean_cmd_duration_decimals $decimals + set -g tide_cmd_duration_threshold $threshold + set -g tide_cmd_duration_decimals $decimals - lean_decolor (_lean_cmd_duration) + tide_decolor (_tide_cmd_duration) end @test 'Less than threshold' (_cmd_duration 2000 3000 0) -z diff --git a/tests/context.fish b/tests/context.fish index cfba240..be7adf8 100644 --- a/tests/context.fish +++ b/tests/context.fish @@ -1,11 +1,11 @@ @mesg '-----------context-----------' -set -l sourceFile "$__fish_config_dir/functions/_lean_context.fish" +set -l sourceFile "$__fish_config_dir/functions/_tide_context.fish" function _context - lean_decolor (_lean_context) + tide_decolor (_tide_context) end @test 'None' (_context) -z @test 'SSH' (set -g SSH_TTY 'true'; _context) = $USER'@'(prompt_hostname)' ' -@test 'Root' (lean_decolor (su -c "fish -c 'source $sourceFile;_lean_context'")) = 'root@'(prompt_hostname)' ' \ No newline at end of file +@test 'Root' (tide_decolor (su -c "fish -c 'source $sourceFile;_tide_context'")) = 'root@'(prompt_hostname)' ' \ No newline at end of file diff --git a/tests/jobs.fish b/tests/jobs.fish index 8fc8421..bccac93 100644 --- a/tests/jobs.fish +++ b/tests/jobs.fish @@ -1,8 +1,8 @@ @mesg '-------------jobs-------------' function _jobs - lean_decolor (_lean_jobs) + tide_decolor (_tide_jobs) end @test 'No Jobs' (_jobs) -z -@test 'Jobs' (sleep 60 &; _jobs) = "$lean_jobs_icon " \ No newline at end of file +@test 'Jobs' (sleep 60 &; _jobs) = "$tide_jobs_icon " \ No newline at end of file diff --git a/tests/pwd.fish b/tests/pwd.fish index 798bda8..4cc0189 100644 --- a/tests/pwd.fish +++ b/tests/pwd.fish @@ -2,10 +2,10 @@ function _pwd -a dir cd $dir - lean_decolor (_lean_pwd) + tide_decolor (_tide_pwd) end -set -l unwr "$lean_pwd_unwritable_icon " +set -l unwr "$tide_pwd_unwritable_icon " @test '/' (_pwd '/') = $unwr'/ ' @test '/usr' (_pwd '/usr') = $unwr'/usr ' diff --git a/tests/status.fish b/tests/status.fish index 9ae68f8..f60f98a 100644 --- a/tests/status.fish +++ b/tests/status.fish @@ -3,12 +3,12 @@ function _status set -g last_pipestatus $pipestatus set -g last_status $status - lean_decolor (_lean_status) + tide_decolor (_tide_status) end @test 'true' (true; _status) -z @test 'false' (false; _status) -z -@test 'true|false' (true|false; _status) = "$lean_status_failure_icon 0|1 " +@test 'true|false' (true|false; _status) = "$tide_status_failure_icon 0|1 " @test 'true|true' (true|true; _status) -z -@test 'false|true' (false|true; _status) = "$lean_status_success_icon 1|0 " -@test 'false|false' (false|false; _status) = "$lean_status_failure_icon 1|1 " \ No newline at end of file +@test 'false|true' (false|true; _status) = "$tide_status_success_icon 1|0 " +@test 'false|false' (false|false; _status) = "$tide_status_failure_icon 1|1 " \ No newline at end of file diff --git a/lean_theme/configure/choices/finish.fish b/tide_theme/configure/choices/finish.fish similarity index 69% rename from lean_theme/configure/choices/finish.fish rename to tide_theme/configure/choices/finish.fish index b265e9e..888ae06 100644 --- a/lean_theme/configure/choices/finish.fish +++ b/tide_theme/configure/choices/finish.fish @@ -1,5 +1,5 @@ function finish - _title 'Overwrite lean config?' + _title 'Overwrite tide config?' _option y 'Yes' printf '%b' '\n\n' @@ -10,12 +10,12 @@ function finish switch (_menu 'Choice' y/n) case y - set -U lean_right_prompt_items 'status' 'cmd_duration' 'context' 'jobs' - if test -z $lean_time_format - set -a lean_right_prompt_items 'time' + set -U tide_right_prompt_items 'status' 'cmd_duration' 'context' 'jobs' + if test -z $tide_time_format + set -a tide_right_prompt_items 'time' end - set -l vars lean_{ \ + set -l vars tide_{ \ newline, \ left_prompt_items, \ prompt_connection_color, prompt_connection_icon, \ diff --git a/lean_theme/configure/choices/prompt_connection.fish b/tide_theme/configure/choices/prompt_connection.fish similarity index 57% rename from lean_theme/configure/choices/prompt_connection.fish rename to tide_theme/configure/choices/prompt_connection.fish index f8842fe..540e451 100644 --- a/lean_theme/configure/choices/prompt_connection.fish +++ b/tide_theme/configure/choices/prompt_connection.fish @@ -2,25 +2,25 @@ function prompt_connection _title 'Prompt Connection' _option 1 'Disconnected' - _display_prompt fake_lean_prompt_connection_icon ' ' + _display_prompt fake_tide_prompt_connection_icon ' ' _option 2 'Dotted' - _display_prompt fake_lean_prompt_connection_icon '·' + _display_prompt fake_tide_prompt_connection_icon '·' _option 3 'Solid' - _display_prompt fake_lean_prompt_connection_icon '─' + _display_prompt fake_tide_prompt_connection_icon '─' _display_restart_and_quit switch (_menu 'Choice' 1/2/3/r/q) case 1 - set -g fake_lean_prompt_connection_icon ' ' + set -g fake_tide_prompt_connection_icon ' ' _next_choice 'prompt_spacing' case 2 - set -g fake_lean_prompt_connection_icon '·' + set -g fake_tide_prompt_connection_icon '·' _next_choice 'prompt_connection_color' case 3 - set -g fake_lean_prompt_connection_icon '─' + set -g fake_tide_prompt_connection_icon '─' _next_choice 'prompt_connection_color' case r _begin diff --git a/lean_theme/configure/choices/prompt_connection_color.fish b/tide_theme/configure/choices/prompt_connection_color.fish similarity index 52% rename from lean_theme/configure/choices/prompt_connection_color.fish rename to tide_theme/configure/choices/prompt_connection_color.fish index 8fa76e0..d4384c6 100644 --- a/lean_theme/configure/choices/prompt_connection_color.fish +++ b/tide_theme/configure/choices/prompt_connection_color.fish @@ -2,31 +2,31 @@ function prompt_connection_color _title 'Connection Color' _option 1 'Lightest' - _display_prompt fake_lean_prompt_connection_color 808080 + _display_prompt fake_tide_prompt_connection_color 808080 _option 2 'Light' - _display_prompt fake_lean_prompt_connection_color 6C6C6C + _display_prompt fake_tide_prompt_connection_color 6C6C6C _option 3 'Dark' - _display_prompt fake_lean_prompt_connection_color 585858 + _display_prompt fake_tide_prompt_connection_color 585858 _option 4 'Darkest' - _display_prompt fake_lean_prompt_connection_color 444444 + _display_prompt fake_tide_prompt_connection_color 444444 _display_restart_and_quit switch (_menu 'Choice' 1/2/3/4/r/q) case 1 - set -g fake_lean_prompt_connection_color 808080 + set -g fake_tide_prompt_connection_color 808080 _next_choice 'prompt_spacing' case 2 - set -g fake_lean_prompt_connection_color 6C6C6C + set -g fake_tide_prompt_connection_color 6C6C6C _next_choice 'prompt_spacing' case 3 - set -g fake_lean_prompt_connection_color 585858 + set -g fake_tide_prompt_connection_color 585858 _next_choice 'prompt_spacing' case 4 - set -g fake_lean_prompt_connection_color 444444 + set -g fake_tide_prompt_connection_color 444444 _next_choice 'prompt_spacing' case r _begin diff --git a/lean_theme/configure/choices/prompt_height.fish b/tide_theme/configure/choices/prompt_height.fish similarity index 61% rename from lean_theme/configure/choices/prompt_height.fish rename to tide_theme/configure/choices/prompt_height.fish index 329fcc1..618b8f6 100644 --- a/lean_theme/configure/choices/prompt_height.fish +++ b/tide_theme/configure/choices/prompt_height.fish @@ -2,22 +2,22 @@ function prompt_height _title 'Prompt Height?' _option 1 'One line' - set -g fake_lean_left_prompt_items 'pwd' 'git_prompt' 'prompt_char' - # fake_lean_count_left_prompt_height + set -g fake_tide_left_prompt_items 'pwd' 'git_prompt' 'prompt_char' + # fake_tide_count_left_prompt_height _display_prompt _option 2 'Two lines' - set -g fake_lean_left_prompt_items 'pwd' 'git_prompt' 'newline' 'prompt_char' + set -g fake_tide_left_prompt_items 'pwd' 'git_prompt' 'newline' 'prompt_char' _display_prompt _display_restart_and_quit switch (_menu 'Choice' 1/2/r/q) case 1 - set -g fake_lean_left_prompt_items 'pwd' 'git_prompt' 'prompt_char' + set -g fake_tide_left_prompt_items 'pwd' 'git_prompt' 'prompt_char' _next_choice 'prompt_spacing' case 2 - set -g fake_lean_left_prompt_items 'pwd' 'git_prompt' 'newline' 'prompt_char' + set -g fake_tide_left_prompt_items 'pwd' 'git_prompt' 'newline' 'prompt_char' _next_choice 'prompt_connection' case r _begin diff --git a/lean_theme/configure/choices/prompt_spacing.fish b/tide_theme/configure/choices/prompt_spacing.fish similarity index 59% rename from lean_theme/configure/choices/prompt_spacing.fish rename to tide_theme/configure/choices/prompt_spacing.fish index 29fd3bb..4ed7e17 100644 --- a/lean_theme/configure/choices/prompt_spacing.fish +++ b/tide_theme/configure/choices/prompt_spacing.fish @@ -2,23 +2,23 @@ function prompt_spacing _title 'Prompt Spacing' _option 1 'Compact' - _display_prompt fake_lean_newline true + _display_prompt fake_tide_newline true _cursor_up 1 - _display_prompt fake_lean_newline false + _display_prompt fake_tide_newline false _option 2 'Sparse' - _display_prompt fake_lean_newline true + _display_prompt fake_tide_newline true _cursor_up 1 - _display_prompt fake_lean_newline true + _display_prompt fake_tide_newline true _display_restart_and_quit switch (_menu 'Choice' 1/2/r/q) case 1 - set -g fake_lean_newline false + set -g fake_tide_newline false _next_choice 'finish' case 2 - set -g fake_lean_newline true + set -g fake_tide_newline true _next_choice 'finish' case r _begin diff --git a/lean_theme/configure/choices/show_time.fish b/tide_theme/configure/choices/show_time.fish similarity index 62% rename from lean_theme/configure/choices/show_time.fish rename to tide_theme/configure/choices/show_time.fish index c06ddf7..f1ad012 100644 --- a/lean_theme/configure/choices/show_time.fish +++ b/tide_theme/configure/choices/show_time.fish @@ -2,25 +2,25 @@ function show_time _title 'Show current time?' _option 1 'No' - _display_prompt fake_lean_time_format '' + _display_prompt fake_tide_time_format '' _option 2 '24-hour format' - _display_prompt fake_lean_time_format '%T' + _display_prompt fake_tide_time_format '%T' _option 3 '12-hour format' - _display_prompt fake_lean_time_format '%r' + _display_prompt fake_tide_time_format '%r' _display_restart_and_quit switch (_menu 'Choice' 1/2/3/r/q) case 1 - set -g fake_lean_time_format '' + set -g fake_tide_time_format '' _next_choice 'prompt_height' case 2 - set -g fake_lean_time_format '%T' + set -g fake_tide_time_format '%T' _next_choice 'prompt_height' case 3 - set -g fake_lean_time_format '%r' + set -g fake_tide_time_format '%r' _next_choice 'prompt_height' case r _begin diff --git a/lean_theme/configure/functions/fake_lean_left_prompt.fish b/tide_theme/configure/functions/fake_lean_left_prompt.fish similarity index 54% rename from lean_theme/configure/functions/fake_lean_left_prompt.fish rename to tide_theme/configure/functions/fake_lean_left_prompt.fish index 7e22f85..219f510 100644 --- a/lean_theme/configure/functions/fake_lean_left_prompt.fish +++ b/tide_theme/configure/functions/fake_lean_left_prompt.fish @@ -1,5 +1,5 @@ -function fake_lean_left_prompt - for item in fake_lean_{$fake_lean_left_prompt_items} +function fake_tide_left_prompt + for item in fake_tide_{$fake_tide_left_prompt_items} set -l itemOutput (_$item) printf '%b' "$itemOutput" diff --git a/lean_theme/configure/functions/fake_lean_right_prompt.fish b/tide_theme/configure/functions/fake_lean_right_prompt.fish similarity index 75% rename from lean_theme/configure/functions/fake_lean_right_prompt.fish rename to tide_theme/configure/functions/fake_lean_right_prompt.fish index 300f2af..34b4c3a 100644 --- a/lean_theme/configure/functions/fake_lean_right_prompt.fish +++ b/tide_theme/configure/functions/fake_lean_right_prompt.fish @@ -1,4 +1,4 @@ -function fake_lean_right_prompt +function fake_tide_right_prompt set -l splitText (string split '\n' (_fetch_right_prompt_items)) set -l printAtEndedRightPromptHeight (count $splitText) @@ -12,7 +12,7 @@ end function _fetch_right_prompt_items printf '%s' ' ' - for item in fake_lean_{$fake_lean_right_prompt_items} + for item in fake_tide_{$fake_tide_right_prompt_items} set -l itemOutput (_$item) printf '%s' "$itemOutput" @@ -21,7 +21,7 @@ function _fetch_right_prompt_items end function _print_at_end -a text - set -l startLocation (math $fake_columns -(string length (lean_decolor $text))) + set -l startLocation (math $fake_columns -(string length (tide_decolor $text))) _cursor_right $startLocation printf '%s' $text diff --git a/tide_theme/configure/functions/fake_prompt.fish b/tide_theme/configure/functions/fake_prompt.fish new file mode 100644 index 0000000..70c94c8 --- /dev/null +++ b/tide_theme/configure/functions/fake_prompt.fish @@ -0,0 +1,15 @@ +function fake_prompt + if test "$fake_tide_newline" = 'true' + printf '\n' + end + + set_color $fake_tide_prompt_connection_color + printf "%.s$fake_tide_prompt_connection_icon" (seq $fake_columns) + set_color $fish_color_normal + + printf '\r' + fake_tide_right_prompt + + printf '\r' + fake_tide_left_prompt +end \ No newline at end of file diff --git a/tide_theme/configure/prompt_items/_fake_lean_cmd_duration.fish b/tide_theme/configure/prompt_items/_fake_lean_cmd_duration.fish new file mode 100644 index 0000000..6eaf43d --- /dev/null +++ b/tide_theme/configure/prompt_items/_fake_lean_cmd_duration.fish @@ -0,0 +1,4 @@ +function _fake_tide_cmd_duration + set_color $tide_cmd_duration_color + printf '%s ' '5s' +end \ No newline at end of file diff --git a/tide_theme/configure/prompt_items/_fake_lean_git_prompt.fish b/tide_theme/configure/prompt_items/_fake_lean_git_prompt.fish new file mode 100644 index 0000000..0de7388 --- /dev/null +++ b/tide_theme/configure/prompt_items/_fake_lean_git_prompt.fish @@ -0,0 +1,4 @@ +function _fake_tide_git_prompt + set_color $tide_color_green + printf '%s ' 'master' +end \ No newline at end of file diff --git a/tide_theme/configure/prompt_items/_fake_lean_newline.fish b/tide_theme/configure/prompt_items/_fake_lean_newline.fish new file mode 100644 index 0000000..a3cc5e3 --- /dev/null +++ b/tide_theme/configure/prompt_items/_fake_lean_newline.fish @@ -0,0 +1,3 @@ +function _fake_tide_newline + printf '%s' '\n' +end \ No newline at end of file diff --git a/tide_theme/configure/prompt_items/_fake_lean_prompt_char.fish b/tide_theme/configure/prompt_items/_fake_lean_prompt_char.fish new file mode 100644 index 0000000..71b79f3 --- /dev/null +++ b/tide_theme/configure/prompt_items/_fake_lean_prompt_char.fish @@ -0,0 +1,4 @@ +function _fake_tide_prompt_char + set_color $tide_color_green + printf '%s ' '❯' +end \ No newline at end of file diff --git a/tide_theme/configure/prompt_items/_fake_lean_pwd.fish b/tide_theme/configure/prompt_items/_fake_lean_pwd.fish new file mode 100644 index 0000000..35631b4 --- /dev/null +++ b/tide_theme/configure/prompt_items/_fake_lean_pwd.fish @@ -0,0 +1,14 @@ +function _fake_tide_pwd + set_color -o $tide_color_light_blue + printf '%s' '~' + set_color normal + + set_color $tide_color_dark_blue + printf '%s' '/' + set_color normal + + set_color -o $tide_color_light_blue + printf '%s' 'src' + + printf '%s' ' ' +end \ No newline at end of file diff --git a/tide_theme/configure/prompt_items/_fake_lean_time.fish b/tide_theme/configure/prompt_items/_fake_lean_time.fish new file mode 100644 index 0000000..99c1ad1 --- /dev/null +++ b/tide_theme/configure/prompt_items/_fake_lean_time.fish @@ -0,0 +1,4 @@ +function _fake_tide_time + set_color $fake_tide_time_color + printf '%s ' (date +$fake_tide_time_format) +end \ No newline at end of file diff --git a/lean_theme/functions/configure.fish b/tide_theme/functions/configure.fish similarity index 70% rename from lean_theme/functions/configure.fish rename to tide_theme/functions/configure.fish index 2fa229a..c343742 100644 --- a/lean_theme/functions/configure.fish +++ b/tide_theme/functions/configure.fish @@ -1,4 +1,4 @@ -function lean_configure +function tide_configure if test $COLUMNS -lt 55 || test $LINES -lt 21 echo 'Terminal size too small; must be at least 55 x 21' return 1 @@ -10,10 +10,10 @@ function lean_configure end set -g fake_lines $LINES - for fn in $lean_dir/configure/functions/* + for fn in $tide_dir/configure/functions/* source "$fn" end - for promptItem in $lean_dir/configure/prompt_items/* + for promptItem in $tide_dir/configure/prompt_items/* source "$promptItem" end @@ -27,22 +27,22 @@ end function _set_defaults if test $fake_lines -ge 26 - set -g fake_lean_newline true + set -g fake_tide_newline true else - set -g fake_lean_newline false + set -g fake_tide_newline false end - set -g fake_lean_left_prompt_items 'pwd' 'git_prompt' 'newline' 'prompt_char' - set -g fake_lean_right_prompt_items 'cmd_duration' 'time' + set -g fake_tide_left_prompt_items 'pwd' 'git_prompt' 'newline' 'prompt_char' + set -g fake_tide_right_prompt_items 'cmd_duration' 'time' - set -g fake_lean_time_format '' - set -g fake_lean_time_color 5F8787 - set -g fake_lean_prompt_connection_icon ' ' - set -g fake_lean_prompt_connection_color 6C6C6C + set -g fake_tide_time_format '' + set -g fake_tide_time_color 5F8787 + set -g fake_tide_prompt_connection_icon ' ' + set -g fake_tide_prompt_connection_color 6C6C6C end function _next_choice -a nextChoice - source "$lean_dir/configure/choices/$nextChoice.fish" + source "$tide_dir/configure/choices/$nextChoice.fish" $nextChoice end @@ -93,7 +93,7 @@ end function _quit --on-signal INT source "$__fish_config_dir/functions/fish_prompt.fish" - source "$__fish_config_dir/functions/lean_left_prompt.fish" - source "$__fish_config_dir/functions/lean_right_prompt.fish" + source "$__fish_config_dir/functions/tide_left_prompt.fish" + source "$__fish_config_dir/functions/tide_right_prompt.fish" clear end \ No newline at end of file diff --git a/lean_theme/functions/help.fish b/tide_theme/functions/help.fish similarity index 83% rename from lean_theme/functions/help.fish rename to tide_theme/functions/help.fish index 3d160b1..0c50876 100644 --- a/lean_theme/functions/help.fish +++ b/tide_theme/functions/help.fish @@ -1,7 +1,7 @@ -function lean_help -a subcommand +function tide_help -a subcommand set -g b (set_color -o) set -g n (set_color normal) - set -g g (set_color $lean_color_green) + set -g g (set_color $tide_color_green) set -g subcommandList \ 'configure' \ @@ -9,7 +9,7 @@ function lean_help -a subcommand 'help' set -g descriptionList \ 'run interactive configuration wizard' \ - 'uninstall lean theme' \ + 'uninstall tide theme' \ 'print this help message' if contains $subcommand $subcommandList @@ -21,7 +21,7 @@ function lean_help -a subcommand return 0 end - echo 'Usage: '$g'lean '$n$b'subcommand '$n'[options]' + echo 'Usage: '$g'tide '$n$b'subcommand '$n'[options]' echo echo 'Subcommands:' echo @@ -33,7 +33,7 @@ function lean_help -a subcommand echo echo 'Print help for a specific subcommand:' echo - echo ' '$g'lean '$n'help '$b'subcommand'$n + echo ' '$g'tide '$n'help '$b'subcommand'$n set -a rmVars b n g subcommandList descriptionList for var in $rmVars @@ -51,7 +51,7 @@ function _generic_help_sub -a subcommand set -l descriptionFirstLetter (string sub -l 1 $description) set -l upperDescriptionFirstLetter (string upper $descriptionFirstLetter) - echo 'Usage: '$g'lean '$n$b$subcommand$n + echo 'Usage: '$g'tide '$n$b$subcommand$n echo string replace $descriptionFirstLetter $upperDescriptionFirstLetter $description end \ No newline at end of file diff --git a/lean_theme/functions/uninstall.fish b/tide_theme/functions/uninstall.fish similarity index 63% rename from lean_theme/functions/uninstall.fish rename to tide_theme/functions/uninstall.fish index 6e66928..6595ae3 100644 --- a/lean_theme/functions/uninstall.fish +++ b/tide_theme/functions/uninstall.fish @@ -1,70 +1,70 @@ -function lean_uninstall - if not _user_confirm_defaultNo 'Uninstall lean theme?' +function tide_uninstall + if not _user_confirm_defaultNo 'Uninstall tide theme?' echo 'Aborted uninstall.' return 1 end - echo 'Uninstalling lean theme...' + echo 'Uninstalling tide theme...' set -l fishPrompt (functions -D fish_prompt) # ----------------------------------Remove Files---------------------------------- - if test -e $lean_dir - rm -r $lean_dir + if test -e $tide_dir + rm -r $tide_dir end set -l fishPromptFirstLine (head -n 1 $fishPrompt) - if test "$fishPromptFirstLine" = '# Created by lean configure' + if test "$fishPromptFirstLine" = '# Created by tide configure' rm $fishPrompt source "$__fish_data_dir/functions/fish_prompt.fish" end - set -a leanFunctions 'lean' - set -a leanFunctions 'lean_'{'decolor', 'left_prompt', 'right_prompt'} - set -a leanFunctions '_lean_'{'cmd_duration', 'context', 'git_prompt', 'jobs', 'newline', 'prompt_char', 'pwd', 'status', 'time'} - for func in $leanFunctions + set -a tideFunctions 'tide' + set -a tideFunctions 'tide_'{'decolor', 'left_prompt', 'right_prompt'} + set -a tideFunctions '_tide_'{'cmd_duration', 'context', 'git_prompt', 'jobs', 'newline', 'prompt_char', 'pwd', 'status', 'time'} + for func in $tideFunctions rm "$__fish_config_dir/functions/$func.fish" end - set -a leanConfd 'lean_'{'count_left_prompt_height', 'cursor_movement'} - for file in $leanConfd + set -a tideConfd 'tide_'{'count_left_prompt_height', 'cursor_movement'} + for file in $tideConfd rm "$__fish_config_dir/conf.d/$file.fish" end # -----------------------------Erase Theme Variables------------------------------ set -l rmVars \ # ---------------General Theme Variables--------------- - 'lean'{'dir', 'newline'} \ + 'tide'{'dir', 'newline'} \ # --------------Colors-------------- - 'lean_color_'{'green', 'light_blue', 'dark_blue', 'gold', 'lilac'} \ + 'tide_color_'{'green', 'light_blue', 'dark_blue', 'gold', 'lilac'} \ # ---------Prompt Connection--------- - 'lean_prompt_connection_'{'icon', 'color'} \ + 'tide_prompt_connection_'{'icon', 'color'} \ # --------------------Prompt Items-------------------- - 'lean_'{'right_prompt_items', 'left_prompt_items', 'left_prompt_height'} \ + 'tide_'{'right_prompt_items', 'left_prompt_items', 'left_prompt_height'} \ # ----------------Pwd---------------- - 'lean_pwd_'{'shorten_margin', 'unwritable_icon'} \ + 'tide_pwd_'{'shorten_margin', 'unwritable_icon'} \ # ------------Git prompt------------ '__fish_git_prompt_'{'show_informative_status', 'showstashstate'} \ # -------Symbols------- - '__fish_git_prompt_char_'{'stateseparator', 'cleanstate', 'upstream_ahead', 'upstream_behind'} \ + '__fish_git_prompt_char_'{'stateseparator', 'ctidestate', 'upstream_ahead', 'upstream_behind'} \ '__fish_git_prompt_char_'{'stagedstate', 'dirtystate', 'untrackedfiles', 'stashstate'} \ # --------Colors-------- '__fish_git_prompt_color_'{'branch', 'upstream', 'stagedstate', 'dirtystate', 'untrackedfiles', 'stashstate'} \ # --------------Status-------------- - 'lean_status_'{'success_icon', 'success_color', 'failure_icon', 'failure_color'} \ + 'tide_status_'{'success_icon', 'success_color', 'failure_icon', 'failure_color'} \ # ------------Cmd_Duration----------- - 'lean_cmd_duration_'{'color', 'decimals', 'threshold'} \ + 'tide_cmd_duration_'{'color', 'decimals', 'threshold'} \ # ----------------SSH---------------- - 'lean_context_'{'ssh_color', 'root_color'} \ + 'tide_context_'{'ssh_color', 'root_color'} \ # ---------------Jobs--------------- - 'lean_jobs_'{'icon', 'color'} \ + 'tide_jobs_'{'icon', 'color'} \ # ---------------Time--------------- - 'lean_time_'{'format', 'color'} + 'tide_time_'{'format', 'color'} for var in $rmVars set -e $var end - echo 'Lean theme uninstalled.' + echo 'Tide theme uninstalled.' end function _user_confirm_defaultNo -a question