-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdot_aliases.tmpl
More file actions
155 lines (130 loc) · 3.84 KB
/
dot_aliases.tmpl
File metadata and controls
155 lines (130 loc) · 3.84 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
{{- $profile := .profile | default "basic" }}
# neovim aliases (runtime check)
if command -v nvim >/dev/null 2>&1; then
alias vi="nvim"
alias vim="nvim"
alias view="nvim -R"
fi
alias gitpullall='for d in ~/git/*/.git; do (cd "${d%/.git}" && echo "Updating $(basename "$PWD")" && git pull); done'
# Check all subdirectories for uncommitted/unpushed git changes
gitstatus() {
local dir="${1:-.}"
local found_issues=false
for d in "$dir"/*/.git; do
[ -d "$d" ] || continue
local repo_dir="${d%/.git}"
local repo_name=$(basename "$repo_dir")
cd "$repo_dir" || continue
local status_msg=""
# Check for uncommitted changes
if ! git diff-index --quiet HEAD -- 2>/dev/null; then
status_msg="uncommitted changes"
fi
# Check for unpushed commits
local unpushed=$(git rev-list @{u}..HEAD --count 2>/dev/null)
if [ -n "$unpushed" ] && [ "$unpushed" -gt 0 ]; then
[ -n "$status_msg" ] && status_msg="${status_msg}, "
status_msg="${status_msg}${unpushed} unpushed commit(s)"
fi
if [ -n "$status_msg" ]; then
printf "\033[1;33m%s:\033[0m %s\n" "$repo_name" "$status_msg"
found_issues=true
fi
cd - >/dev/null || return
done
if [ "$found_issues" = false ]; then
echo "✓ All repositories are clean and up to date"
fi
}
# dstask aliases (runtime check)
if command -v dstask >/dev/null 2>&1; then
alias t="dstask"
alias ta="dstask add"
alias tc="dstask context"
alias tcc="dstask context --"
alias td="dstask done"
alias te="dstask edit"
alias th="dstask help"
alias tl="dstask log"
alias tm="dstask modify"
alias tn="dstask note"
alias to="dstask open"
alias tr="dstask remove"
alias tsp="dstask show-projects"
alias tst="dstask show-tags"
alias tsa="dstask show-active"
alias tso="dstask show-open"
alias tsr="dstask show-resolved"
alias tsu="dstask show-unorganised"
alias tsy="dstask sync"
fi
# gopass aliases (runtime check)
if command -v gopass >/dev/null 2>&1; then
alias pass=gopass
alias unlock-pve="gopass show -o encryption/proxmox/disk | ssh -T pve 'sudo /home/claus/unlock-encrypted.sh'"
fi
# fabric-ai aliases (runtime check)
if command -v fabric-ai >/dev/null 2>&1; then
alias fabric="fabric-ai"
alias f="fabric-ai"
fi
# Darwin-specific aliases
{{- if eq .chezmoi.os "darwin" }}
alias pp="pbpaste"
alias pc="pbcopy"
alias typora="open -a typora"
{{- end }}
# zoxide aliases (runtime check - smart directory jumping)
if command -v zoxide >/dev/null 2>&1; then
alias cd="z"
fi
if command -v zellij >/dev/null 2>&1; then
# Note: 'z' is reserved for zoxide (smart directory jumping)
alias zj="zellij"
alias zjl="zellij ls"
alias zja="zellij a"
alias zjs="zellij -s"
fi
# bat aliases (runtime check - bat in basic profile)
if command -v bat >/dev/null 2>&1; then
alias catp="bat -pp" # Plain cat without decorations
export MANPAGER="sh -c 'col -bx | bat -l man -p'" # Use bat for man pages
fi
if command -v opencode >/dev/null 2>&1; then
alias oc="opencode"
ocw() {
export OPENCODE_WORK_DATA="$HOME/.local/share-work/"
export OPENCODE_WORK_CONFIG="$HOME/.config-work/opencode"
mkdir -p "$OPENCODE_WORK_CONFIG"
XDG_DATA_HOME="$OPENCODE_WORK_DATA" \
OPENCODE_CONFIG_DIR="$OPENCODE_WORK_CONFIG" \
opencode
}
fi
if command -v claude >/dev/null 2>&1; then
alias claude-unsafe="claude --allow-dangerously-skip-permissions"
fi
if command -v ytt >/dev/null 2>&1 && command -v glow >/dev/null 2>&1; then
yts() {
local lang="en"
local f_lang="en"
while [[ $# -gt 0 ]]; do
case "$1" in
-l)
lang="$2"
shift 2
;;
-g=*)
f_lang="${1#-g=}"
shift
;;
*)
break
;;
esac
done
ytt -l "$lang" "$@" \
| f -g="$f_lang" -p youtube_summary \
| glow -p
}
fi