-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.profile
72 lines (58 loc) · 1.8 KB
/
.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
66
67
68
69
70
71
72
platform=`(uname -a | awk '{print $1}')`
if [[ $platform == "Darwin" ]]; then
alias gvim='\mvim -O'
else
alias gvim='\gvim -O'
fi;
alias rm='\rm -i'
alias cat='\cat -n -s'
alias ls='clear; \ls --color=auto -A -a -F -G -h -l -p '
#Go to Home
alias gitdiff='git difftool --no-prompt'
alias findcpp='find . -name "*.h" -o -name "*.cpp" -o -name "*.c"'
alias findpy='find . -name "*.h" -o -name "*.cpp" -o -name "*.c"'
alias grepcpp='findcpp | xargs grep '
alias greppy='findpy | xargs grep '
#Set WorkEnv
export EDITOR=vi
# history
bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'
export HISTCONTROL=ignoredups
export HISTFILESIZE=20000
set -o emacs
shopt -s extglob
alias truncdir='pwd | sed "s/\(\/[^\/]*\/[^\/]*\/[^\/]*\)\(\/[^\/]*\).*\(\/[^\/]*\/[^\/]*\)$/...\3/g"'
PS1='`truncdir`\$ '
function prompt {
local ORANGE="\[\033[0;33m\]"
local GREEN="\[\033[0;32m\]"
local RED="\[\033[0;31m\]"
local BLUEBOLD="\[\033[0;34m\]"
local RESET="\[\033[00m\]"
local git_branch="(\$(git rev-parse --abbrev-ref HEAD 2>/dev/null))"
local curr_dir='`truncdir`'
#export PS1="\n$BLACKBOLD[\t]$GREEN@\h$RESET:$BLUEBOLD$RESET\n$RED$git_branch$RESET"'$'
if [[ $platform == "Darwin" ]]; then
export PS1="\n$ORANGE[\@]$RESET$RED$git_branch$RESET:$BLUEBOLD$curr_dir$RESET\n"'$'
else
export PS1="\n$ORANGE[\@]$RESET$GREEN[\h]$RESET$RED$git_branch$RESET:$BLUEBOLD$curr_dir$RESET\n"'$'
fi;
}
prompt
#Colorization options
export PAGER=less
export TERM=xterm-color
export GREP_OPTIONS='--color=auto'
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
fi
if [ -f ~/.profile.local ]; then
source ~/.profile.local
fi
settitle()
{
printf \\033]0\;\%s\\007 "$@"
}
alias ls-size="du -sh * | sort -rh"
alias space="df -h ."