Skip to content

Commit 819e695

Browse files
committed
ctrl-branch: Make [m] shortcut always main
1 parent f9357ea commit 819e695

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

.oh-my-zsh/ctrl-branch/ctrl-branch.plugin.zsh

+10-5
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,22 @@ ctrl-branch-command() {
2323
branch=${branch%% *}
2424
BRANCHES+=($branch)
2525

26-
## get shortcut
26+
## assign shortcuts
2727
# XXX get symbol shortcut instead of numeric
2828
# XXX empty labels when exhausted
29-
# XXX [m] always main
30-
HOTKEYS+=($i)
31-
((i++))
29+
30+
# [m] always main
31+
if [[ $branch == "main" ]]; then
32+
HOTKEYS+=("m")
33+
else
34+
HOTKEYS+=($i)
35+
((i++))
36+
fi
3237
done
3338

3439
i=1
3540
for m in $MENU; do
36-
print $HOTKEYS[$i] $m
41+
print $HOTKEYS[$i]")" $m
3742
((i++))
3843
done
3944

0 commit comments

Comments
 (0)