diff --git a/fish_prompt.fish b/fish_prompt.fish new file mode 100644 index 0000000..1ec8463 --- /dev/null +++ b/fish_prompt.fish @@ -0,0 +1,30 @@ +function fish_prompt + set s $status + set p (basename (prompt_pwd)) + if [ (echo "$p" | wc -m) -gt 32 ] + set p (echo "$p" | cut -c1-31) + set of "…" + end + set_color -o green + echo -n "[" + set_color -o white + echo -n "$p" + if [ $of ] + set_color black + echo -n $of + end + if [ $s -ne 0 ] + set_color red + echo -n " $s" + end + set_color -o green + set g $(fish_git_prompt) + if [ $status = 0 ] + echo -n "]" + set_color -o purple + echo -n "$g " + else + echo -n "] " + end +end +