-
Notifications
You must be signed in to change notification settings - Fork 2
/
aliases.zsh
68 lines (49 loc) · 1.53 KB
/
aliases.zsh
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
# Reload zsh + tmux config:
alias s="reload"
# Needs alias in order to overwrite built-in "r" command:
alias r='joshuto --output-file /tmp/joshutodir; LASTDIR=`cat /tmp/joshutodir`; cd "$LASTDIR"'
# use "just server" instead?
alias pythonserver="python3 -m http.server 8000"
alias showFiles='defaults write com.apple.finder AppleShowAllFiles YES;
killall Finder /System/Library/CoreServices/Finder.app'
alias rust="evcxr"
# Go to the "experiments" folder
alias exp='cd ~/dev/projects/experiments'
alias ord='~/dev/projects/ordinals/ord-api/target/debug/ord'
alias ls='eza -a'
# git UI
alias gg="gitui"
v() {
# hermit messes up rust-analyzer sometimes. Don't use it in neovim:
if [ -n "$HERMIT_ENV" ] && command -v deactivate-hermit > /dev/null 2>&1; then
deactivate-hermit
fi
if [ $# -gt 0 ]; then
nvim "$@"
else
nvim
fi
}
ports() {
lsof -iTCP -sTCP:LISTEN -n -P | awk 'NR>1 {print $9, $1, $2}' | sed 's/.*://' | while read port process pid; do echo "Port $port: $(ps -p $pid -o command= | sed 's/^-//') (PID: $pid)"; done | sort -n
}
# Python
# alias python='python3'
# alias pip='pip3'
# Postgres CLI
alias pg='pgcli postgres'
# Used in create/add scripts:
set_github_secret_from_op() {
key=$1
op_secret_ref=$2
export $key="$op_secret_ref"
value="$(op run --no-masking -- printenv $key)"
gh secret set $key --body $value
}
set_github_variable_from_op() {
key="TMP_$1"
op_secret_ref=$2
export $key="$op_secret_ref"
value="$(op run --no-masking -- printenv $key)"
gh variable set $key --body $value
}