-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_sh_aliases.tmpl
53 lines (44 loc) · 1.55 KB
/
dot_sh_aliases.tmpl
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
overrideIfInstalled () {
type "$2" >/dev/null 2>&1 && alias "$1"="$2"
}
overrideIfInstalled vim lvim
overrideIfInstalled kc kubectl
overrideIfInstalled kx kubectx
overrideIfInstalled cat bat
overrideIfInstalled grep rg
overrideIfInstalled fd fdfind
chezmoiAliased() {
if [ $# -eq 1 ]; then
if [ "$1" = "st" ]; then
chezmoi status
elif [ "$1" = "di" ]; then
chezmoi diff
else
chezmoi "$@"
fi
else
chezmoi "$@"
fi
}
alias ch=chezmoiAliased
alias fvim="fd --type f --hidden --exclude .git --print0 | fzf-tmux -p -- --read0 --print0 --exit-0 | xargs -r -0 lvim"
alias cp="cp -i" # confirm before overwriting something
alias df="df -h" # human-readable sizes
alias more="less"
alias k9s="k9s --logoless"
{{ if eq .chezmoi.username "clifford" }}
{{- /* only on personal machine */ -}}
alias kubectl="minikube kubectl --"
alias kc="minikube kubectl --"
overrideIfInstalled docker podman
overrideIfInstalled docker-compose podman-compose
alias obstatus="rclone check --filter '- .git/**' gdrive:/knowledgebase /home/clifford/Documents/knowledgebase/"
alias obpull="rclone sync --filter '- .git/**' -i gdrive:/knowledgebase /home/clifford/Documents/knowledgebase/"
alias obpush="rclone sync --filter '- .git/**' -i /home/clifford/Documents/knowledgebase/ gdrive:/knowledgebase"
{{- end }}
alias network-displays="G_MESSAGES_DEBUG=all flatpak run org.gnome.NetworkDisplays"
watchpytest () {
GLOB=${1:-"./"}
# Using fd-find syntax
fdfind . -e py "$GLOB" | entr -d -s "pytest $GLOB"
}