-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.bashrc
More file actions
130 lines (92 loc) · 3.22 KB
/
Copy path.bashrc
File metadata and controls
130 lines (92 loc) · 3.22 KB
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
119
120
121
122
123
124
125
126
127
128
129
130
#!/usr/bin/env sh
umask 022
alias ls='ls -GFT' # use \ls to execute non-aliased command
alias ll='ls -l'
alias la='ls -A'
alias rm='rm -i'
alias -- ..='cd ../'
alias -- ...='cd ../../'
alias -- ....='cd ../../../'
alias tree='tree -ACF'
alias git-branch-cleanup='git branch --merged | grep -v "\*" | xargs -pn 1 git branch -d'
if [ -d /usr/local/bin ]; then
PATH="/usr/local/bin:${PATH}"
fi
if [ -d /usr/local/sbin ]; then
PATH="/usr/local/sbin:${PATH}"
fi
if [ -d /usr/local/share/npm/bin ]; then
PATH="/usr/local/share/npm/bin:${PATH}"
fi
if [ -d /usr/local/share/python ]; then
PATH="/usr/local/share/python:${PATH}"
fi
if [ -d ~/bin ]; then
PATH="~/bin:${PATH}"
fi
#show pwd as absolute path and make prompt colorful
PS1='\[$(tput setaf 2)\]\u@\h: \[$(tput setaf 4)\]\w\[$(tput setaf 5)\]'
#add bash completion support
if [ -f /usr/local/etc/bash_completion ]; then
. /usr/local/etc/bash_completion
# show dirty state
export GIT_PS1_SHOWDIRTYSTATE=1
# show dirty state with colorful
export GIT_PS1_SHOWCOLORHINTS=1
# append git-prompt to $PS1
PS1+='$(__git_ps1 " (%s)")'
if hash grunt 2>/dev/null; then
eval "$(grunt --completion=bash)"
fi
fi
#Git
#avoid interactive session for merge commit
export GIT_MERGE_AUTOEDIT=no
#show $ prompt at new line
PS1+='\n\[$(tput setaf 1)\]\$\[$(tput sgr0)\] '
export PS1
#add auto-completion for rbenv
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
#add jsctags to node path
export NODE_PATH="/usr/local/lib/jsctags:${NODE_PATH}"
#prevent symlink resolution
export _Z_NO_RESOLVE_SYMLINKS=1
[[ -f /usr/local/etc/profile.d/z.sh ]] && . /usr/local/etc/profile.d/z.sh
#set vim as default editor
export EDITOR="vim"
#turn off special handling of ._* files in tar, etc in MAC OS X 10.5+
export COPYFILE_DISABLE=true
#ignoredups ignorespace for bash history
export HISTCONTROL=ignoreboth:erasedups
#define how many histories that history command will return
export HISTSIZE=10000
#define how many histories can be saved in .bash_history
export HISTFILESIZE=100000
#append last command to history file when runs every command
export PROMPT_COMMAND="history -a;$PROMPT_COMMAND"
#set ignored command list
export HISTIGNORE="ls:[bf]g:exit:pwd:clear:cd"
#add datetime to history and make it colorful
export HISTTIMEFORMAT="[$(tput setaf 6)%F %T$(tput sgr0)]: "
#ignore unwanted file when using bash completion
export FIGNORE="DS_Store:${FIGNORE}"
#save multiple line commands into a singile history line
shopt -s cmdhist
#append to history file rather than overwrite
shopt -s histappend
#check the window size after each command and, if necessary, update the values of LINES and COLUMNS.
shopt -s checkwinsize
#put failed substitution command back on the command line as it has typed
shopt -s histreedit
#expand history related command rather than directly execute it
shopt -s histverify
#ignore common spelling/path mistakes for cd command
shopt -s cdspell
#docker default machine
if docker-machine env default &> /dev/null; then eval "$(docker-machine env default)"; fi
#ensure pager defined in .gitconfig is being used
unset GIT_PAGER
#ensure editor deinfed in .gitconfig is being used
unset GIT_EDITOR
#enfore english as environment language
LC_ALL=en_US