feat(zsh): drop ohmyzsh+git for custom aliases
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user