-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.aliases
74 lines (65 loc) · 1.96 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
#!/usr/bin/env sh
# Aliases that can be shared between bash and zsh
if [ -e ~/.private_aliases ]; then
source ~/.private_aliases
fi
# Use coreutils for sorting by file extension if available through homebrew
if ! alias lx > /dev/null 2>&1; then
if [[ -x $(which brew) && -d $(brew --prefix coreutils) ]]; then
alias lx="$(brew --prefix coreutils)/bin/gls -lahX --color=auto"
fi
fi
# Aliases
alias ..2="cd ../.."
alias ..3="cd ../../.."
alias ..4="cd ../../../.."
alias ..="cd .."
alias aliases="$EDITOR ~/.aliases"
alias c="pbcopy"
alias cgrep="grep -I -n --color=always --exclude=tags"
alias rg="cgrep -rn"
alias fucking="sudo"
alias gitconfig="$EDITOR ~/.gitconfig"
alias l="ls -laGh"
alias lz="ls -laGhS"
alias ll="clear; l"
alias tree="tree -C"
alias nvimrc="$EDITOR ~/.config/nvim/init.vim"
alias path="echo $PATH | tr ':' '\n' | sort -u"
alias pdfs="cd ~/Dropbox/PDFs"
alias projects="cd ~/Dropbox/projects"
alias sbp="source ~/.bash_profile"
alias todo="grep --color=always --exclude-dir=tmp -HIni ' todo:'"
alias up="cd .."
alias updatedb="sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist"
alias upl="cd .. && l"
alias v="pbpaste"
alias vbundle="cd ~/.vim/bundle"
alias vh=vimhelp
alias vimrc="$EDITOR ~/.vimrc"
vimhelp() {
vim -c "help $1 | only"
}
man() {
/usr/bin/man $@ | col -b | vim -R -c "set ft=man nomod nolist" -
}
tophist() {
local top="$1"
if [ -z "$top" ]; then
top=3
fi
history | awk '{print $2}' | awk 'BEGIN {FS="|"}{print $1}' | sort | uniq -c | sort -nr | head -n $top
}
# Short-hand function for activating a top-level virtual environment directory
sve() {
if [ -z "$1" ]; then
if [ -n "$VIRTUAL_ENV" ]; then
printf "Current virtual environment is '$VIRTUAL_ENV'\n"
else
printf "No currently active virtual environment\n"
fi
else
source "$1/bin/activate"
printf "%s\n" "Virtual environment '$VIRTUAL_ENV' is active"
fi
}