Skip to content

Instantly share code, notes, and snippets.

@bodadotsh
Created February 28, 2025 22:00
Show Gist options
  • Save bodadotsh/619eba6465707a618d34afdaf31534af to your computer and use it in GitHub Desktop.
Save bodadotsh/619eba6465707a618d34afdaf31534af to your computer and use it in GitHub Desktop.
fish_prompt
function fish_prompt
# TODO: set username here!
set -l current_path (pwd | string replace -r '^(/home/<your_username>)?/?' '~/' )
set -l git_branch (git branch --show-current 2>/dev/null)
set -l virtualenv (if set -q VIRTUAL_ENV; echo "($VIRTUAL_ENV)"; end)
set_color -o yellow
echo -n "$current_path"
if test -n "$git_branch"
set_color -o magenta
echo -n " ($git_branch)"
end
set_color -o cyan
echo -n " $virtualenv"
# newline here - after all prompt elements
echo ""
set_color normal
echo -n "> "
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment