-
Notifications
You must be signed in to change notification settings - Fork 0
/
.aliases
56 lines (42 loc) · 1.98 KB
/
.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
48
49
50
51
52
53
54
55
56
# ~/.aliases for macOS
# ===============================
# easier navigation: .. & ...
alias ..="cd .."
alias ...="cd ../.."
# mv, rm, cp
alias mv="mv -v"
alias rm="\rm -v -i"
alias cp="cp -v"
# safe alternative to `rm` | npm install -g trash-cli
hash trash >/dev/null 2>&1 || alias rm="trash"
# use coreutils 'ls' | brew install coreutils
hash gls >/dev/null 2>&1 || alias gls="ls"
# always use color, even when piping (to awk, grep, etc)
if gls --color > /dev/null 2>&1; then color="--color"; else color="-G"; fi;
export CLICOLOR_FORCE=1
alias ls='gls -N ${color}'
alias lsd='ls -l | grep "^d"' # only directories
alias ll='ls -oh ${color}' # long format (without group id)
alias l.='ls -A ${color}' # Show hidden files
alias ll.='ls -Aho ${color}' # Show hidden files in long format
# https://tinyurl.com/y8syjq3c
# alias wget="wget --hsts-file ~/.config/wget/wget-hsts"
# npm / yarn global packages
alias npm_leaves="npm ls --depth=0 -g"
alias yarn_leaves="yarn global list"
# print homebrew depenency graph
alias brew_graph="brew-graph --installed --highlight-leaves | dot -T png -o ~/brew-graph.png && open ~/brew-graph.png"
# show/hide hidden files in Finder
alias show_dotfiles="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder"
alias hide_dotfiles="defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder"
# show/hide all desktop icons
alias show_desktop="defaults write com.apple.finder CreateDesktop -bool true && killall Finder"
alias hide_desktop="defaults write com.apple.finder CreateDesktop -bool false && killall Finder"
# recursively remove '.DS_Store' files | https://goo.gl/YH43N2
alias ds_store_delete="find . -name '.DS_Store' -type f -delete 2>&1 | grep -v 'Operation not permitted'"
# postgreSQL
alias pg-start="pg_ctl -D /usr/local/var/postgres start"
alias pg-stop="pg_ctl -D /usr/local/var/postgres stop"
alias pg-restart="pg_ctl -D /usr/local/var/postgres restart"
# gh cli
alias gho="gh repo view --web"