-
Notifications
You must be signed in to change notification settings - Fork 0
/
_bashrc
118 lines (98 loc) · 3 KB
/
_bashrc
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# .bashrc
# set terminal to 256 colors if available
if [ -e /usr/share/terminfo/s/screen-256color ]; then
export TERM='screen-256color'
elif [ -e /usr/share/terminfo/x/xterm-256color ]; then
export TERM='xterm-256color'
elif [ -e /usr/share/terminfo/x/xterm+256color ]; then
export TERM='xterm-256color'
else
export TERM='xterm'
fi
# don't put duplicate lines in the history. See bash(1) for more options
# # ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
HISTTIMEFORMAT="%Y-%m-%d %H:%M:%S "
# append to the history file, don't overwrite it
shopt -s histappend
# Set HISTSIZE and HISTFILESIZE to an empty value as we append and love our history :)
# unset isn't working. It will be reset to 500 everytime!
export HISTSIZE=
export HISTFILESIZE=
# Save history immediatly after running command
# With "history -n" it's possible to read all new lines since last read
PROMPT_COMMAND="history -a"
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# Enable color prompt
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\] \$ '
else
PS1='\u@\h:\w$ \$ '
fi
# User specific aliases and functions
alias ....='cd ../../..'
alias ...='cd ../..'
alias ..='cd ..'
alias :q='logout'
alias cat='bat'
alias cp='cp -i'
alias df='df -h'
alias grep='grep --color=auto -E'
alias gs='git status'
alias ll='ls -al --color=auto'
alias mkdir='mkdir -p'
alias mv='mv -i'
alias pci='puppet cert sign'
alias pp='cd /etc/puppetlabs/code'
alias rm='rm -i'
alias ta='tmux attach'
alias tailf='tail -F'
alias tat='tmux attach -t'
alias tls='tmux ls'
alias tns='tmux new-session -s'
alias vim='vim -p'
alias ws='cd ~/workspace'
# Set to 'C' to make ls sort dotfiles
# export LC_COLLATE=C
# Set to UTF-8 and english locale
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
# Set the right editor
export EDITOR='vim'
function fawk {
first="awk '{print "
last="}'"
cmd="${first}\$${1}${last}"
eval "$cmd"
}
# ssh() {
# if [ "$(ps -p $(ps -p $$ -o ppid=) -o comm=)" = "tmux" ]; then
# tmux rename-window "$(echo $* | cut -d . -f 1)"
# command ssh "$@"
# tmux set-window-option automatic-rename "on" 1>/dev/null
# else
# command ssh "$@"
# fi
# }
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
export GIT_PROMPT_ONLY_IN_REPO=0
export GIT_PROMPT_THEME=Custom
if [ -f /etc/bash_completion.d ]; then
source /etc/bash_completion.d
fi
if [ -f ~/.bash-git-prompt/gitprompt.sh ]; then
source ~/.bash-git-prompt/gitprompt.sh
fi
# add "thefuck" alias
# eval $(thefuck --alias)
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"
[ -f ~/.fzf.bash ] && source ~/.fzf.bash