forked from vpetkov/rcfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnew_bash_profile
65 lines (56 loc) · 1.38 KB
/
new_bash_profile
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
# PATHS
PATH="/usr/local/sbin:$PATH"
PATH="$HOME/bin:$PATH"
export PATH=$PATH
# PROMPT
source ~/.git-prompt.sh
PS1='\n\d \t\n$PWD$(__git_ps1 " \033[0;33m%s\033[0m")\n '
# ALIASES
alias bash_profile='vi ~/.bash_profile && . ~/.bash_profile'
alias vimrc='vi ~/.vimrc'
alias gitconfig='vi ~/.gitconfig'
alias hosts='sudo vi /etc/hosts'
alias ls='ls -GF'
alias ll='ls -lh'
alias la='ll -A'
alias l='ls -1'
alias py='python'
alias gg='git st'
alias gd='git diff'
alias gl='git oneline'
alias vi='vim -p'
alias b='bundle exec'
# COMPLETION
source ~/.git-completion.bash
# Add tab completion for SSH hostnames based on ~/.ssh/config, ignoring wildcards
[ -e "$HOME/.ssh/config" ] && complete -o "default" -o "nospace" -W "$(grep "^Host" ~/.ssh/config | grep -v "[?*]" | cut -d " " -f2)" scp sftp ssh
# HISTORY
HISTSIZE=50000
HISTFILESIZE=$HISTSIZE
SHELL_SESSION_HISTORY=0
HISTIGNORE="ls*:ll:la:l:cd:gd:gg:gl*:gf:vg"
HISTCONTROL=ignoredups:ignorespace:erasedups # do not duplicate lines
shopt -s histappend # append the history file instead overwriting
# RBENV
if type rbenv > /dev/null; then
eval "$(rbenv init -)"
fi
# FUNCTIONS
function title {
echo -en "\033]0;$@\007"
}
function f {
ack -g $@ | ack $1
}
function a {
if [ -d "${!#}" ]; then
arg_length=$(($#-1))
query=${@:1:$arg_length}
eval "ack \"${query}\" ${!#}"
else
eval "ack \"${@}\" ."
fi
}
function def {
a def $@
}