Skip to content

Instantly share code, notes, and snippets.

@edysmp
edysmp / minimal_zshrc_0.sh
Last active October 6, 2025 18:03 — forked from njgibbon/minimal_zshrc_0.sh
Minimal .zshrc to output git branch name in prompt.
# Find and set branch name var if in git repository.
function git_branch_name()
{
branch=$(git symbolic-ref HEAD 2> /dev/null | awk 'BEGIN{FS="/"} {print $NF}')
if [[ $branch == "" ]];
then
:
else
echo '- ('$branch')'
fi