-
Notifications
You must be signed in to change notification settings - Fork 0
/
.mybashrc
87 lines (71 loc) · 2.21 KB
/
.mybashrc
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
#!/usr/bin/env bash
################################################################################
_PS1='\[\033[01;31m\]\h \[\033[01;34m\]\w\[\033[00m\]'
PS1=$_PS1'\n'
# disable ctrl-s that freezes the shell
if [ -t 0 ]; then
stty ixany
stty ixoff -ixon
fi
################################################################################
# alias
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias l='ls -AFGh --color'
alias ll='ls -AFGlh --color'
alias kk='ll'
alias lt='ls -AFGlrth --color'
alias h='history'
alias j="jobs -l"
alias pu="pushd"
alias po="popd"
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias dir='ls -ba'
alias ss="ps -aux"
alias dot='ls .[a-zA-Z0-9_]*'
alias m="less"
alias v="vim"
# ignore some commands in history
export HISTIGNORE="&:ll:l:[bf]g:exit:open"
export HISTCONTROL=ignoreboth:erasedups
export HISTSIZE=10000
# path short cuts
export CDPATH=.:~
# encoding
export LANG=en_US.UTF-8
export LC_ALL=$LANG
export LANGUAGE=$LANG
# misc
export GREP_OPTIONS='--color=auto --exclude=*\.svn*'
export PAGER=less
# export LESS='-MN'
include () { test -f "$1" && source "$1"; }
# python start file
export PYTHONSTARTUP=~/dotfiles/.pythonrc
################################################################################
. ~/dotfiles/.shoptrc
################################################################################
# MODULES
if include ~/local/Modules/default/init/bash ; then
module load scons/2.1.0
module load vim/7.4-027
module load git/1.8.2
module load bash-completion/1.3
fi
################################################################################
[[ $PS1 ]] && include ~/local/bash-completion/1.3/etc/bash_completion
################################################################################
# GIT
include $GIT_CONTRIB_PATH/completion/git-completion.bash
include $GIT_CONTRIB_PATH/completion/git-prompt.sh
include /usr/share/git-core/contrib/completion/git-prompt.sh
if type __git_ps1 >/dev/null 2>&1; then
PS1=$_PS1' \[\033[01;31m\]$(__git_ps1 "(%s) ")\[\033[00m\]\n'
fi
################################################################################
# cdtng helper
cdtng() { eval `$1 --version $2 --setenvironment $3`; }
export -f cdtng