-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompletions.zsh
More file actions
77 lines (62 loc) · 2.57 KB
/
completions.zsh
File metadata and controls
77 lines (62 loc) · 2.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# ─────────────────────────────────────────────────────────────
# Zsh Completions for Git Shortcuts
# ─────────────────────────────────────────────────────────────
# Source: ~/.scripts/completions.zsh
# Ensure compinit is loaded
autoload -Uz compinit && compinit
# ─────────────────────────────────────────────────────────────
# Alias Completions (Map to standard git completions)
# ─────────────────────────────────────────────────────────────
# gsw -> git switch
compdef _git gsw=git-switch
# gco -> git checkout
compdef _git gco=git-checkout
# gl -> git log
compdef _git gl=git-log
# gd -> git diff
compdef _git gd=git-diff
# gb -> git branch
compdef _git gb=git-branch
# gaa -> git add
compdef _git gaa=git-add
# gs -> git status
compdef _git gs=git-status
# ─────────────────────────────────────────────────────────────
# Custom Function Completions
# ─────────────────────────────────────────────────────────────
# gcb - Create and switch to new branch
_gcb_completion() {
_arguments \
'1: :_guard "^-*" "New Branch Name"'
}
compdef _gcb_completion gcb
# commit - Stage all and commit
_commit_completion() {
_arguments \
'1: :_guard "^-*" "Commit Message"'
}
compdef _commit_completion commit
# push - Push current branch
_push_completion() {
_arguments \
'*: :_guard "^-*" "No arguments needed (pushes current branch)"'
}
compdef _push_completion push
# pull - Pull current branch
_pull_completion() {
_arguments \
'*: :_guard "^-*" "No arguments needed (pulls current branch)"'
}
compdef _pull_completion pull
# Other simple commands
_simple_completion() {
_arguments \
'*: :_guard "^-*" "No arguments needed"'
}
compdef _simple_completion drop
compdef _simple_completion uncommit
compdef _simple_completion dropcommit
compdef _simple_completion sum
compdef _simple_completion cws
compdef _simple_completion cwsp
compdef _simple_completion ghelp