-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bashrc
executable file
·221 lines (187 loc) · 6.32 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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=999999
HISTFILESIZE=50000
# Catch terminal window resizes properly: check the window size after each
# command and, if necessary, update the values of LINES and COLUMNS.
shopt -s checkwinsize
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# Enable 256 color capabilities if dircolors exist
# (ls --color=auto) will use solarized colors
hash dircolors 2>/dev/null && eval `dircolors $HOME/.dircolors`
# enable bash completion in interactive shells
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
# GIT AUTOCOMPLETE
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f ~/.git-completion.bash ]; then
source ~/.git-completion.bash
fi
# CUDA
# export LD_LIBRARY_PATH=/usr/local/cuda/lib64/${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
# export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/cuda/lib64/${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
# export CPATH=/usr/local/cuda/include${CPATH:+:${CPATH}}
# export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}
# export CUDA_ROOT=/usr/local/cuda/
# texlive path
# export PATH=/usr/local/texlive/2016/bin/x86_64-linux${PATH:+:${PATH}}
# export INFOPATH=/usr/local/texlive/2016/texmf-dist/doc/info
# PATHS
#=======
# export PYTHONPATH_INIT="$PYTHONPATH"
export PATH=$HOME/.local/bin:${PATH:+:${PATH}}
# export PATH_INIT="$PATH"
# Set TMP
export TMP='/tmp'
export TMPDIR='/tmp'
# OTHERS
#========
export EDITOR=vim
# Ctrl-D
IGNOREEOF=10 # Shell only exists after the 10th consecutive Ctrl-d
# autojump
[[ -s /u/visin/.autojump/etc/profile.d/autojump.sh ]] && source /u/visin/.autojump/etc/profile.d/autojump.sh
# cool bash and git bash extension
if [ -f ~/.git-prompt.sh ]; then
source ~/.git-prompt.sh
fi
# SOLARIZED
# if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then TERM=gnome-256color; fi
# See http://unix.stackexchange.com/questions/105926/how-to-include-commands-in-bashs-ps1-without-breaking-line-length-calculation
# You can get a list of colors with:
# for i in {0..255}; do
# printf "\x1b[38;5;${i}mcolour${i}\x1b[0m\n"
# done
if tput setaf 1 &> /dev/null; then
tput sgr0
if [[ $(tput colors) -ge 256 ]] 2>/dev/null; then
BASE03=$(tput setaf 234)
BASE02=$(tput setaf 235)
BASE01=$(tput setaf 240)
BASE00=$(tput setaf 241)
BASE0=$(tput setaf 244)
BASE1=$(tput setaf 245)
BASE2=$(tput setaf 254)
BASE3=$(tput setaf 230)
YELLOW=$(tput setaf 136)
ORANGE=$(tput setaf 166)
RED=$(tput setaf 160)
MAGENTA=$(tput setaf 125)
VIOLET=$(tput setaf 61)
BLUE=$(tput setaf 33)
CYAN=$(tput setaf 37)
GREEN=$(tput setaf 64)
else
BASE03=$(tput setaf 8)
BASE02=$(tput setaf 0)
BASE01=$(tput setaf 10)
BASE00=$(tput setaf 11)
BASE0=$(tput setaf 12)
BASE1=$(tput setaf 14)
BASE2=$(tput setaf 7)
BASE3=$(tput setaf 15)
YELLOW=$(tput setaf 3)
ORANGE=$(tput setaf 9)
RED=$(tput setaf 1)
MAGENTA=$(tput setaf 5)
VIOLET=$(tput setaf 13)
BLUE=$(tput setaf 4)
CYAN=$(tput setaf 6)
GREEN=$(tput setaf 2)
fi
BOLD=$(tput bold)
RESET=$(tput sgr0)
# else
# Linux console colors. I don't have the energy
# to figure out the Solarized values
# foreground colors
# BLACK=\e[0;30m # Black
# RED=\e[0;31m # Red
# GREEN=\e[0;32m # Green
# YELLOW=\e[0;33m # Yellow
# BLUE=\e[0;34m # Blue
# PURPLE=\e[0;35m # Purple
# CYAN=\e[0;36m # Cyan
# WHITE=\e[0;37m # White
# MAGENTA="\033[1;31m"
# ORANGE="\033[1;33m"
# GREEN="\033[1;32m"
# PURPLE="\033[1;35m"
# WHITE="\033[1;37m"
# BOLD=""
# RESET="\033[m"
fi
if [ -f /.dockerenv ]; then
BASH_COLOR=${ORANGE}
else
BASH_COLOR=${GREEN}
fi
# Hide conda current env in the prompt
if hash conda 2>/dev/null; then
conda config --set changeps1 False
fi
# format bash
# RESET=${WHITE}
PS1='\[${BASH_COLOR}\]┌─────── \u@\h\[${BLUE}\] [\w]\[${YELLOW}\]$(__git_ps1 " (%s)")\n\[${BASH_COLOR}\]└─ ${CONDA_DEFAULT_ENV} λ \[${RESET}\]'
# VIRTUAL_ENV_DISABLE_PROMPT=1 source ~/Enthought/Canopy_64bit/User/bin/activate
# If this is an gnome-terminal set the title to user@host:dir
# For konsole, just modify the preferences to print %w
# Set an xterm title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
;;
esac
# Uncomment to use my own conda env
# export PATH=$HOME/.miniconda/bin:$PATH
# History stuff
export HISTFILESIZE=1000000000
export HISTSIZE=1000000
export HISTTIMEFORMAT="%F %T "
shopt -s cmdhist
shopt -s histappend
# added by Miniconda3 installer
# export PATH="$HOME/miniconda3/bin:$PATH" # commented out by conda initialize
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/ciccone/miniconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/home/ciccone/miniconda3/etc/profile.d/conda.sh" ]; then
. "/home/ciccone/miniconda3/etc/profile.d/conda.sh"
else
export PATH="/home/ciccone/miniconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
[ -f ~/.fzf.bash ] && source ~/.fzf.bash