+ fish_prompt.fish

This commit is contained in:
Nazrin 2024-04-22 17:57:47 +00:00
parent e0ddc61e75
commit e7ea6404cb

30
fish_prompt.fish Normal file
View file

@ -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