-
Notifications
You must be signed in to change notification settings - Fork 0
/
bashrc
194 lines (160 loc) · 4.8 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific environment
if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]]
then
PATH="$HOME/.local/bin:$HOME/bin:$PATH"
fi
export PATH
# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=
# User specific aliases and functions
#
# Path settings
#
export PATH=~/bin:/apps/sss/share:/apps/sssdev/share:/sbin:/usr/sbin:$PATH #:/usr/share/lmod/lmod/libexec
#set proxy settings
#
# Required for sqlplus to edit the last command with ed
#
#export EDITOR="gvim -f"
if xhost >& /dev/null ; then export EDITOR="gvim -f"; else export EDITOR="vim"; fi
#
# for ccache to go to a new folder
#
export CCACHE_DIR=/scratch/ccache-hernandezjj
# for tmux histcontrol
export HISTCONTOROL=ignoreboth
#
# Enable core files
#
ulimit -c unlimited
#
# Git complition sourcing
#
source /scratch/hernandezjj/home/git-completion.bash 2>/dev/null
#
# add diff so fancy
#
export PATH=$PATH:/scratch/git/diff-so-fancy
#
# add fzf to my path
#
if [ -z "${VNC}" ]
then
[ -f ~/.fzf.bash ] && source ~/.fzf.bash 2>/dev/null
fi
#
# colors used in PS1
#
BOLD="\[\e[1m\]"
RED="\[\e[31m\]"
YELLOW="\[\e[33m\]"
CYAN="\[\e[36m\]"
MAGENTA="\[\e[35m\]"
RESET="\[\e[0m\]"
#
# create private functions
#
#
# git branch status and name in PS1
#
parse_git_dirty() {
[[ $(git rev-parse --git-dir 2>/dev/null) && $(git status -uno 2> /dev/null | tail -n1) != "nothing to commit (use -u to show untracked files)" ]] && echo '!'
}
parse_git_branch() {
branch=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
if [ $? -eq 0 ]
then
echo ${branch} | sed -e "s/* \(.*\)/\1/"
else
echo ':-|'
fi
}
setCursorColor() {
echo -ne "\e]12;$1\a";
}
#
# hernandezjj's personal preferences
#
#met kleur
#export PS1='\[\e[36;1m\]\[\033[1m\]\h\[\033[0m\]:\W:\$:'
export PS1="\`ex=\$?; if [ \$(date +%k) -lt 17 ]; then echo [${BOLD}\@${RESET}]; else echo [${RED}${BOLD}go home${RESET}]; fi; exit \$ex\`:${CYAN}${BOLD}\h${RESET}:\$(if [ \$? = 0 ]; then echo ${MAGENTA}^_^${RESET}; else echo ${RED}O_O${RESET}; fi):\W:(${YELLOW}\$(parse_git_branch)${RESET}${RED}\$(parse_git_dirty)${RESET})\$ "
export PS2="${CYAN}${BOLD}And then?>${RESET}"
#Ninja status message
export NINJA_STATUS="[%p %s/%t %u] "
#stop closing of shell
export IGNOREEOF=10
#oud
#export PS1='\h:\W:\$ '
alias ls='ls -lhF --color=auto --time-style=long-iso'
alias rm='rm -I'
alias l='ls'
alias vncserver='vncserver -geometry 1600x920 -depth 16 -dpi 96'
alias vnclaptop='vncserver -geometry 1366x768 -depth 16 -dpi 96'
alias grepn='grep -n'
alias mplayer='mplayer -brightness 0 -contrast 0 -hue 0 -saturation 0 -edlout edlout -nosound -zoom -vf screenshot -vo x11 -noborder'
alias splayer='/usr/bin/mplayer -brightness 0 -contrast 0 -edlout edlout'
alias gn='gnuplot'
alias mount='mount | column -t'
alias jobs='jobs -l'
alias tailf='multitail -f'
alias git-root='cd $(git rev-parse --show-toplevel)'
alias envgrep='env | grep'
alias jpenvgrep='jprun env | grep'
alias vim='vim -b'
alias gvim='gvim -b'
alias tarc="tar -cvzf"
alias pdf='evince'
alias dropbox='/scratch/git/Dropbox-Uploader/dropbox_uploader.sh'
alias calendar='PATH=/usr/bin/:PATH calendar'
alias loadmodule='. /apps/sss/Lmod/etc/profile.d/z01_lmod-hpcs.sh'
alias vi='vimx'
alias vim='vimx'
alias grpe='grep'
alias gti='git'
alias gotorelease='cd /apps/sssdev/jobpro/dev'
alias setrhel8mods='source ~/bin/setmodulepath.sh 8'
alias setrhel7mods='source ~/bin/setmodulepath.sh 7'
#alias jobpro="jobpro -reverse"
# add forward search when reverse searching in bash. (ctrl + s when ctrl + r-ing)
[[ $- == *i* ]] && stty -ixon
function git-goto() { worktreepath=$(git worktree list | grep "$1" | cut -f1 -d' '); cd $worktreepath;}
#set ENV variable to locate kshrc when starting ksh
export ENV='~/.kshrc'
#
# Gnuplot font work around
#
export GDFONTPATH=/usr/share/fonts/liberation
export GNUPLOT_DEFAULT_GDFONT=LiberationSans-Regular
#give filetypes a color. check /etc/DIR_COLOR for more info
eval $(dircolors -b /etc/DIR_COLORS)
#if [ $TERM = 'xterm' ] || [ $TERM = 'xterm-color' ]; then
# export PROMPT_COMMAND='echo -ne "\033]2;Terminal:`pwd`\007"'
#fi
# pimp my grep
#export GREP_OPTIONS='--color=auto'
#export GREP_COLOR='1;31'
# use termcap colors in 'less'
# export LESS_TERMCAP_mb=$'\E[01;31m'
# export LESS_TERMCAP_md=$'\E[01;31m'
# export LESS_TERMCAP_me=$'\E[0m'
# export LESS_TERMCAP_se=$'\E[0m'
# export LESS_TERMCAP_so=$'\E[01;44;33m'
# export LESS_TERMCAP_ue=$'\E[0m'
# export LESS_TERMCAP_us=$'\E[01;32m'
# somewhat speed up firefox
# export MOZ_DISABLE_PANGO=1
if [ "$TERM" == "xterm-256color" ]
then
#
# bind keys for cool stuff
#
bind Space:magic-space
#auto complete symlinks including slash
bind 'set mark-symlinked-directories on'
/home/hernandezjj/bin/motd 1>&2
fi