Last active
August 12, 2022 22:08
-
-
Save NatWeiss/90052efc5fc2e52792627c3d0070d990 to your computer and use it in GitHub Desktop.
Fish prompt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fish_prompt | |
set dir (pwd) | |
set dir (string replace '/Users/nat' '~' $dir) | |
set dir (string replace '/home/nat' '~' $dir) | |
set host (hostname 2> /dev/null) | |
set git_branch (git branch 2> /dev/null | sed -e '/^[^\*]/d' -e 's/* (.*)/(1)/') | |
set git_status (git status -s 2> /dev/null | wc -l | xargs) | |
set_color 1F1 | |
echo -n $host':'$dir | |
set_color normal | |
echo ' '$git_branch' * '$git_status | |
set_color 1F1 | |
echo -n '> ' | |
set_color normal | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment