aboutsummaryrefslogtreecommitdiff
path: root/cfg/fish/fish_prompt.fish
diff options
context:
space:
mode:
Diffstat (limited to 'cfg/fish/fish_prompt.fish')
-rw-r--r--cfg/fish/fish_prompt.fish41
1 files changed, 30 insertions, 11 deletions
diff --git a/cfg/fish/fish_prompt.fish b/cfg/fish/fish_prompt.fish
index 916e276..b14256f 100644
--- a/cfg/fish/fish_prompt.fish
+++ b/cfg/fish/fish_prompt.fish
@@ -5,21 +5,40 @@ function fish_prompt
if test "$cwd" = "$home"
# if in ~
- echo -e (set_color white)"╭"(set_color red)"("(set_color white)"$user" \
- (set_color red)"⮞"(set_color white)"⮞"(set_color red)"⮞" \
- (set_color white)"~"(set_color red)")"(set_color red)"\n╰"(set_color normal)"⮞ "
- # ╭(max⮞⮞⮞~)
- # ╰⮞
+ echo -e (set_color white)"("(set_color red)"$user"(set_color white)" at "(set_color red)"~"(set_color white)")\n" \
+ (set_color white)"λ "(set_color normal)
+ # max at ~
+ # λ
else if string match -q "$home/*" $cwd
set -l relative (string replace "$home/" "~/" $cwd)
+ set -l parts (string split "/" $relative)
+ set -l colored ""
+
+ for p in $parts
+ if test -n "$p"
+ set colored $colored(set_color white)$p(set_color red)"/"
+ end
+ end
+
+ set colored (string trim -r -c "/" $colored)
+
# if in a ~ subdir
- echo -e (set_color white)"╭"(set_color red)"("(set_color white)"$user" \
- (set_color red)"⮞"(set_color white)"⮞"(set_color red)"⮞" \
- (set_color white)$relative(set_color red)")"(set_color red)"\n╰"(set_color normal)"⮞ "
+ echo -e (set_color white)"("(set_color red)"$user"(set_color white)" at "(set_color red)"$colored"(set_color white)")\n" \
+ (set_color white)"λ "(set_color normal)
else
+ set -l parts (string split "/" $cwd)
+ set -l colored ""
+
+ for p in $parts
+ if test -n "$p"
+ set colored $colored(set_color white)$p(set_color red)"/"
+ end
+ end
+
+ set colored (string trim -r -c "/" $colored)
+ set colored (set_color red)"#"$colored
# if in any other dir
- echo -e (set_color white)"╭"(set_color red)"("(set_color white)"$user" \
- (set_color red)"⮞"(set_color white)"⮞"(set_color red)"⮞" \
- (set_color white)$cwd(set_color red)")"(set_color red)"\n╰"(set_color normal)"⮞ "
+ echo -e (set_color white)"("(set_color red)"$user"(set_color white)" at "(set_color red)"$colored"(set_color white)")\n" \
+ (set_color white)"λ "(set_color normal)
end
end