-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.shell_aliases
47 lines (38 loc) · 1.11 KB
/
.shell_aliases
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
# 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$//'\'')"'
if which bat > /dev/null; then
alias cat='bat --style=plain'
elif which batcat > /dev/null; then
alias cat='batcat --style=plain'
alias bat='batcat'
fi
if [[ "$(python --version 2>&1)" == *"available"* ]] && which python3 > /dev/null; then
alias python=python3
fi
# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
alias s='du -hs'
alias quit='exit'
alias q='exit'
alias :q='exit'
alias g='git'
alias b='back'
alias b2='back 2'
alias b3='back 3'
alias b4='back 4'
alias b5='back 5'
alias b6='back 6'
alias b7='back 7'
alias b8='back 8'
alias b9='back 9'
alias vim='nvim'
alias vi='nvim'
alias vt='vim $(ls day*.rb | sort | tail -1)'
alias rt='ruby $(ls day*.rb | sort | tail -1)'
alias et='ruby $(ls day*.rb | sort | tail -1) --example'
alias vti='vim $(ls day*.input | sort | tail -1)'
PWD_AT_SHELL_START=$PWD
alias cdd='cd $PWD_AT_SHELL_START'