+ fish_prompt.fish
This commit is contained in:
parent
e0ddc61e75
commit
e7ea6404cb
1 changed files with 30 additions and 0 deletions
30
fish_prompt.fish
Normal file
30
fish_prompt.fish
Normal 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
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue