Download functions using for loop, streamline colors

This commit is contained in:
Ilan Cosman 2020-04-11 14:58:14 -07:00
parent c8d7eecd3e
commit 16edc7f2b8
3 changed files with 27 additions and 22 deletions

View File

@ -7,7 +7,7 @@ function fish_prompt --description 'Write out the prompt'
# Prompt character
set_color $fish_color_normal
if test $last_status -eq 0
set_color $lean_color_prompt_character
set_color $lean_green
else
set_color $fish_color_error
end

View File

@ -3,29 +3,29 @@ function lean_pwd
set pwdSplitLength (count $pwdSplit)
if test $pwdSplit[1] != "~"
set_color -o $lean_color_end_dirs
set_color -o $lean_light_blue
echo -n "/"
set_color $fish_color_normal
else
set_color -o $lean_color_end_dirs
set_color -o $lean_light_blue
echo -n $pwdSplit[1]
set_color $fish_color_normal
if test $pwdSplitLength -gt 1
set_color $lean_color_mid_dirs
set_color $lean_dark_blue
echo -n "/"
set_color $fish_color_normal
end
end
set_color $lean_color_mid_dirs
set_color $lean_dark_blue
echo -n (string join "/" $pwdSplit[2..-2])
if test $pwdSplitLength -gt 2
echo -n "/"
end
set_color $fish_color_normal
set_color -o $lean_color_end_dirs
set_color -o $lean_light_blue
if test $pwdSplitLength -gt 1
echo -n $pwdSplit[-1]
end

View File

@ -1,20 +1,23 @@
echo "Installing lean theme..."
# -------------------Download Files-------------------
set fishFunctionsFolder $__fish_config_dir/functions
set githubFunctionsFolder "https://raw.githubusercontent.com/IlanCosman/lean/master/functions/"
# -------------------Download Functions-------------------
set fns fish_prompt lean_pwd lean_git_prompt
set fishFnsDir "$__fish_config_dir/functions"
set ghubFnsDir "https://raw.githubusercontent.com/IlanCosman/lean/master/functions"
wget -q -P $fishFunctionsFolder $githubFunctionsFolder/fish_prompt.fish
wget -q -P $fishFunctionsFolder $githubFunctionsFolder/lean_pwd.fish
wget -q -P $fishFunctionsFolder $githubFunctionsFolder/lean_git_prompt.fish
for fn in $fns
wget -q -P $fishFnsDir "$ghubFnsDir/$fn.fish"
end
# ----------------Set Theme Variables----------------
# --------------Colors--------------
set -U lean_green 5FD700
set -U lean_light_blue 00AFFF
set -U lean_dark_blue 0087AF
set -U lean_gold D7AF00
# ---------------Pwd---------------
set -U fish_prompt_pwd_dir_length 0
set -U lean_shorten_pwd_margin 5
set -U lean_color_prompt_character 5FD700
set -U lean_color_end_dirs 00AFFF
set -U lean_color_mid_dirs 0087AF
# ------------Git prompt------------
set -U __fish_git_prompt_show_informative_status true
set -U __fish_git_prompt_showstashstate true
@ -28,11 +31,13 @@ set -U __fish_git_prompt_char_dirtystate ' !'
set -U __fish_git_prompt_char_untrackedfiles ' ?'
set -U __fish_git_prompt_char_stashstate " *"
# --------Colors--------
set -U __fish_git_prompt_color_branch 5FD700
set -U __fish_git_prompt_color_upstream 5FD700
set -U __fish_git_prompt_color_stagedstate D7AF00
set -U __fish_git_prompt_color_dirtystate D7AF00
set -U __fish_git_prompt_color_untrackedfiles 00AFFF
set -U __fish_git_prompt_color_stashstate 5FD700
set -U __fish_git_prompt_color_branch $lean_green
set -U __fish_git_prompt_color_upstream $lean_green
set -U __fish_git_prompt_color_stagedstate $lean_gold
set -U __fish_git_prompt_color_dirtystate $lean_gold
set -U __fish_git_prompt_color_untrackedfiles $lean_light_blue
set -U __fish_git_prompt_color_stashstate $lean_green
echo "Lean theme installed! Restart fish to see your new prompt."
set_color $lean_green
echo "Lean theme installed! Restart fish to see your new prompt."
set_color $fish_color_normal