forked from denysdovhan/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
aliases.zsh
88 lines (69 loc) · 2.1 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#
# Aliases
#
# Enable aliases to be sudo’ed
# http://askubuntu.com/questions/22037/aliases-not-available-when-using-sudo
alias sudo='sudo '
_exists() {
command -v $1 > /dev/null 2>&1
}
# Avoid stupidity with trash-cli:
# https://github.com/sindresorhus/trash-cli
# or use default rm -i
if _exists trash; then
alias rm='trash'
fi
# Just bcoz clr shorter than clear
alias clr='clear'
# Go to the /home/$USER (~) directory and clears window of your terminal
alias q="~ && clear"
# Folders Shortcuts
[ -d ~/Downloads ] && alias dl='cd ~/Downloads'
[ -d ~/Desktop ] && alias dt='cd ~/Desktop'
[ -d ~/Projects ] && alias pj='cd ~/Projects'
[ -d ~/Projects/Forks ] && alias pjf='cd ~/Projects/Forks'
[ -d ~/Projects/Job ] && alias pjj='cd ~/Projects/Job'
[ -d ~/Projects/Playground ] && alias pjl='cd ~/Projects/Playground'
[ -d ~/Projects/Repos ] && alias pjr='cd ~/Projects/Repos'
# Commands Shortcuts
alias e="$EDITOR"
alias -- +x='chmod +x'
alias x+='chmod +x'
# Open aliases
alias open='open_command'
alias o='open'
alias oo='open .'
alias term='open -a iterm.app'
# Run scripts
alias update="source $DOTFILES/scripts/update"
alias bootstap="source $DOTFILES/scripts/bootstrap"
# Quick jump to dotfiles
alias dotfiles="code $DOTFILES"
# Quick reload of zsh environment
alias reload="source $HOME/.zshrc"
# My IP
alias myip='ifconfig | sed -En "s/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p"'
# Show $PATH in readable view
alias path='echo -e ${PATH//:/\\n}'
# Download web page with all assets
alias getpage='wget --no-clobber --page-requisites --html-extension --convert-links --no-host-directories'
# Download file with original filename
alias get="curl -O -L"
# Use tldr as help util
if _exists tldr; then
alias help="tldr"
fi
alias git-root='cd $(git rev-parse --show-toplevel)'
if _exists lsd; then
unalias ls
alias ls='lsd'
alias lt='lsd --tree'
fi
# cat with syntax highlighting
# https://github.com/sharkdp/bat
if _exists bat; then
# Run to list all themes:
# bat --list-themes
export BAT_THEME='base16'
alias cat='bat'
fi