Skip to content

Instantly share code, notes, and snippets.

@NatWeiss
Last active August 12, 2022 22:08
Show Gist options
  • Save NatWeiss/90052efc5fc2e52792627c3d0070d990 to your computer and use it in GitHub Desktop.
Save NatWeiss/90052efc5fc2e52792627c3d0070d990 to your computer and use it in GitHub Desktop.
Fish prompt
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