feat(zsh): drop ohmyzsh+git for custom aliases

This commit is contained in:
2026-03-09 13:28:47 +01:00
parent b1cbd7b1fa
commit 6582a55df9
3 changed files with 69 additions and 12 deletions

View File

@@ -1,3 +1,20 @@
# git helpers for aliases
function git_current_branch {
command git rev-parse --abbrev-ref HEAD 2>/dev/null
}
function git_main_branch {
command git rev-parse --git-dir &>/dev/null || return
local ref
for ref in refs/{heads,remotes/{origin,upstream}}/{main,master,trunk}; do
if command git show-ref -q --verify "$ref"; then
echo ${ref:t}
return 0
fi
done
echo main
}
function tmux_attach {
local tmux_running
tmux_running=$(pgrep tmux)