-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathaliases
More file actions
168 lines (128 loc) · 3.66 KB
/
aliases
File metadata and controls
168 lines (128 loc) · 3.66 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
156
157
158
159
160
161
162
163
164
165
166
167
168
########
# Core #
########
alias mkdir='mkdir -p'
alias grep='grep --color=always'
alias ls='ls --color=always'
alias l='ls -lh' # Lists human readable sizes.
alias ll='l -A' # Lists human readable sizes, hidden files.
alias lr='l -R' # Lists human readable sizes, recursively.
alias lt='l -tr' # Lists sorted by date, most recent last.
###########
# Udiskie #
###########
alias um='udiskie-mount --recursive --options noatime'
alias uu='udiskie-umount'
alias up='um --password-prompt "builtin:tty"'
#######
# Git #
#######
# Ripped from Prezto
# https://github.com/sorin-ionescu/prezto/tree/master/modules/git
function git-branch-current {
if ! command git rev-parse 2> /dev/null; then
print "$0: not a repository: $PWD" >&2
return 1
fi
local ref="$(command git symbolic-ref HEAD 2> /dev/null)"
if [[ -n "$ref" ]]; then
print "${ref#refs/heads/}"
return 0
else
return 1
fi
}
alias g='git'
alias gb='git branch'
alias gc='git commit --verbose'
alias gco='git checkout'
alias gia='git add'
alias gm='git merge'
alias gpp='git pull origin "$(git-branch-current 2> /dev/null)" && git push origin "$(git-branch-current 2> /dev/null)"'
alias gwR='git reset --hard'
alias gwd='git diff --no-ext-diff'
alias gwr='git reset --soft'
alias gws='git status --short'
#############
# Git Annex #
#############
alias gx='git annex'
alias gxa='git annex add'
alias gxs='git annex sync'
alias gxg='git annex get'
alias gxd='git annex drop'
alias gxc='git annex copy'
alias gxe='git annex edit'
gxurl() {
REPO="${1:-$HOME/documents}"
less "$REPO"/.git/annex/url
}
###############
# Taskwarrior #
###############
alias t='task'
alias ta='task add'
alias tm='task modify'
alias to='taskopen'
alias ti='task add due:tomorrow tag:inbox'
alias tn='taskopen -a'
alias tt='taskwarrior-tui'
##########
# Pacman #
##########
alias pacx="sudo pacman --remove"
alias pacX="sudo pacman --remove --nosave --recursive"
############
# My Repos #
############
alias lmr='mr --config $HOME/library/src/myrepos.conf --directory=$HOME/library/src'
alias wmr='mr --config $HOME/projects/tad/docs/config/myrepos.conf --directory=$HOME/projects/tad'
alias pmr='mr --config $HOME/projects/.mrconfig --directory=$HOME/projects'
########
# Pass #
########
alias cplogin='sed -n "/^login/Is/login:\s\+//p" | xsel -ib'
alias cpurl='sed -n "/^url/Is/url:\s\+//p" | xsel -ib'
_pw() {
local characters="${1}" length="${2:-25}"
bash -c 'read -r -n "$0" pass < <(LC_ALL=C tr -dc "$1" < /dev/urandom) && echo $pass' $length $characters
}
alias pw='_pw "[:graph:]"'
alias pw:a='_pw "[:alnum:]"'
alias pw:d='_pw "[:digit:]"'
#######
# LLM #
#######
alias cc=claude
alias ccc='claude --continue'
alias ccd='claude --dangerously-skip-permissions'
alias ccr='claude --resume'
alias mig-a="MIGRANT_DIR=$HOME/projects/migrant/arch migrant.sh"
alias mig-d="MIGRANT_DIR=$HOME/projects/migrant/debian migrant.sh"
alias mig-u="MIGRANT_DIR=$HOME/projects/migrant/ubuntu migrant.sh"
########
# Misc #
########
alias mtr-report='mtr --report --report-cycles 10 --no-dns'
alias e='aunpack'
alias http-serve='python -m http.server'
alias bc='bc -lq'
alias utc='env TZ="UTC" date'
alias zt='zulip-term -c ~/.config/zuliprc'
alias ledger-balance='ledger balance assets and not assets:invest liabilities'
alias z='zathura'
iowaiting() {
watch -n 1 "(ps aux | awk '\$8 ~ /D/ { print \$0 }')"
}
def() {
dict $1 | less
}
recordmywindow () {
recordmydesktop --no-sound --windowid $(xwininfo | grep "Window id" | awk '{print $4;}')
}
cheat() {
curl --location --silent "cheat.sh/$1?style=default" | ${PAGER:-less};
}
atree() {
tree -C "$@" | sed 's/ ->.*$//'
}