-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.aliases
91 lines (78 loc) · 2.93 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
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
89
90
91
# Navigation
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
# Shortcuts
alias desk="cd $HOME/Desktop";
alias down="cd $HOME/Downloads";
alias sand="cd $HOME/Study/Sandbox/";
alias week="date +%V"; # week number
# Get OS X Software Updates, and update installed Ruby gems, Homebrew, npm, and their installed packages
alias update='sudo softwareupdate -i -a;
brew update; brew upgrade;
brew cleanup;
brew upgrade node;
npm update npm -g;
npm update -g;
sudo gem update --system;
sudo gem update';
# Recursively delete `.DS_Store` files
alias cleanup="find . -type f -name '*.DS_Store' -ls -delete";
# Empty the Trash on all mounted volumes and the main HDD
# Also, clear Apple’s System Logs to improve shell startup speed
alias emptytrash="sudo rm -rfv /Volumes/*/.Trashes; sudo rm -rfv ~/.Trash; sudo rm -rfv /private/var/log/asl/*.asl";
# Intuitive map function
# For example, to list all directories that contain a certain file:
# find . -name .gitattributes | map dirname
alias map="xargs -n1";
alias stfu="osascript -e 'set volume output muted true'";
alias pumpitup="osascript -e 'set volume 7'";
# Lock the screen (when going AFK)
alias afk=" systemctl suspend -i";
alias bp="code $HOME/dotfiles";
alias enter="ssh [email protected]";
alias portfolio="cd $HOME/Study/Sandbox/portfolio-template && code .";
alias bitbar="kill $(ps -ax | grep BitBar | awk 'NR==1 {print $1;}') && open /Applications/BitBar.app/"
alias fuck='sudo $(history -p \!\!)'
alias hgrep="history | grep "
alias myip="ipconfig getifaddr en0"
alias speedtest='curl -o /dev/null http://speedtest.wdc01.softlayer.com/downloads/test10.zip'
# To add a new vendor to the path, do something like:
# export PATH=${CMDER_ROOT}/vendor/whatever:${PATH}
alias gs='git status'
alias e='explorer .'
alias gl='git log --oneline --all --graph --decorate $1'
alias glme='git log --graph --pretty=format:"%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset" --abbrev-commit --author="Samarth Shah" $1'
alias c='code -g -r $1'
alias tasks='cd /d/rd/Build/src'
alias tasks-init='cd /d/rd/Build/src && start ACR.Build.Linux.sln'
alias ll='ls -alG'
alias tele='cd ~/vso/src/teleport-benchmarks'
alias pjson='python -m json.tool'
alias bashed='source ~/.bash_profile'
alias clip='xclip -sel clip'
alias openfs='xdg-open .'
alias cli='cd ~/code/azure-cli && . ./azure-cli/env/bin/activate'
cdf() {
local dir
dir=$(find ${1:-.} -path '*/\.*' -prune \
-o -type d -print 2> /dev/null | fzf +m) &&
cd "$dir"
}
# brf - checkout git branch
brf() {
local branches branch
branches=$(git branch -vv) &&
branch=$(echo "$branches" | fzf +m) &&
git checkout $(echo "$branch" | awk '{print $1}' | sed "s/.* //")
}
# fuzzy grep open via ag
vg() {
local file
file="$(ag --nobreak --noheading $@ | fzf -0 -1 | awk -F: '{print $1 " +" $2}')"
if [[ -n $file ]]
then
code $file
fi
}