forked from damian/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbash_aliases
80 lines (62 loc) · 1.53 KB
/
bash_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
# Rbenv
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
# Bash completion
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
# Hub - Aliases Hub to Git
eval "$(hub alias -s)"
# Colours in dark terminal
export CLICOLOR=1
export LSCOLORS=dxfxcxdxbxegedabagacad
# Ensure any call to editor opens in VIM
export EDITOR=vim
# Jump to common directories
alias dev="cd ~/development"
# Source any local aliases
if [ -f ~/.bash_aliases.local ]; then
. ~/.bash_aliases.local
fi
# navigation
alias ll="ls -alp"
alias ..="cd .."
alias ...="cd ../.."
# Make a directory and move into it
function take() { mkdir $1; cd $1; }
# Reload aliases
alias reload="source ~/.bash_aliases"
# Edit configs
alias vimconfig="vim ~/.vimrc"
alias bashconfig="vim ~/.bash_aliases"
# Git
alias g="git"
# Autocomplete for 'g' as well
complete -o default -o nospace -F _git g
# Bundler
alias b="bundle"
alias be="bundle exec"
alias run="bundle exec rails s"
# Log
alias tlf='tail -f'
# Bash colours
CYAN="\[\033[0;36m\]"
PURPLE="\[\033[0;35m\]"
WHITE="\[\033[0;37m\]"
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
BLUE="\[\033[0;34m\]"
GREEN="\[\033[0;32m\]"
# Custom prompt
export PS1="$CYAN\w $PURPLE\$(__git_ps1 \"(%s)\")$WHITE § "
# Custom grep
alias dgrep="grep -lir --exclude=\*.svn\* --exclude=\*.swp --exclude=\*.log"
# Find all files below the current directory containing a particular extension
function ff() {
if [ -z "$1" ]
then
echo "You must provide a file type"
else
find . -name "*.$1"
fi
}