-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdot_aliases
More file actions
67 lines (59 loc) · 2.26 KB
/
dot_aliases
File metadata and controls
67 lines (59 loc) · 2.26 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
####################
# Quick commands
####################
# Configuration
alias editaliases='subl -n ~/.aliases; echo "Dont forget to commit any changes using \"chezmoi diff ~/.aliases; chezmoi add ~/.aliases\""'
alias editrc='subl -n ~/.zshrc; echo "Dont forget to commit any changes using \"chezmoi diff ~/.zshrc; chezmoi add ~/.zshrc\""'
# cg
alias ca='cg adv'
alias cal='cg adv list'
alias cas='cg adv show'
alias car='cg adv review'
alias carl='cg adv review list'
alias cg_auth='export HTTP_AUTH="basic:apk.cgr.dev:user:$(chainctl auth token --audience apk.cgr.dev)"'
# Check if eza is installed
if command -v eza > /dev/null 2>&1; then
# Use eza for enhanced navigation
alias l='eza --color=always --color-scale=all --color-scale-mode=gradient --icons=always --group-directories-first -a'
alias ll='eza --color=always --color-scale=all --color-scale-mode=gradient --icons=always --group-directories-first -l --git -h -a'
else
# Fallback to standard ls aliases
alias l='ls -CFA'
alias ll='ls -AlF'
fi
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
# Git-related
# git remote add fork
graf() {
git remote add f "$(git remote get-url origin \
| sed "s|github.com:[^/]*/|github.com:${GITHUB_USERID}/|")"
}
# git clone from local and set up origin/fork
git-clone-from-local-and-fork() {
# input:
# * BRANCH: required
# * OWNER: optional, defaults to "chainguard-dev"
OWNER="${OWNER:-chainguard-dev}"
git -C ../$OWNER/main pull
git-clone.sh ../$OWNER/main/ $BRANCH
cd $BRANCH
git checkout -b $BRANCH
graf
git fetch origin
}
####################
# Quick links to common directories
####################
alias cdcode='cd $CODE_ROOT'
alias cdmono='cd $CODE_ROOT/mono'
alias cdstereo='cd $CODE_ROOT/stereo'
alias cdjunk='cd "$CODE_ROOT/junk"'
alias cdsandbox='cd "$CODE_ROOT/sandbox-of-power"'
alias cdadv='cd "$CODE_ROOT/sandbox-of-power/advisory-browser/andrew.scribner/advisory-browser"'
####################
# Other
####################
# Hint to myself that I should probably use `fd` instead of `find`
alias find='echo "Do you want to do this with fd?"; find'