forked from sorin-ionescu/prezto
-
Notifications
You must be signed in to change notification settings - Fork 1
/
zaliases
50 lines (39 loc) · 1.03 KB
/
zaliases
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
#!/bin/zsh
# system commands
alias du1="du -d 1"
case "$OSTYPE" in
darwin*)
alias dus="du -L -d 1 -h 2>/dev/null | gsort -h"
;;
linux*)
alias dus="du -L -d 1 -h 2>/dev/null | sort -h"
;;
esac
# set silver searcher or ripgrep on linux alias
if type "ripgrep" > /dev/null; then
alias ripgrep="rg"
fi
# fasd aliases for fast directory movement (jj asks for any directory matching a fuzzy search)
if type "fasd" > /dev/null; then
alias j='fasd_cd -d'
alias jj='fasd_cd -d -i'
fi
# Force remove and do so for directories too
alias rmf='rm -r -f'
# Remove last line of file
alias lastlineremove="sed -i '' -e '$ d' foo.txt"
# Tmux aliases
if type "tmux" > /dev/null; then
alias ta='tmux a'
alias tmd='tmux detach'
fi
# Pip install aliases
alias pipi='pip install'
alias pipe='pip install -e'
# Python aliases
alias pytabtospace="find . -name '*.py' -type f -exec bash -c 'T=$(mktemp); expand -t 8 \"\$0\" > \"\$T\" && mv \"\$T\" \"\$0\"' {} \;"
# Kube Aliases
if type "kubectl" > /dev/null; then
alias k='kubectl'
fi
# END