-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bashrc
108 lines (92 loc) · 2.56 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
# ------------------------
# -------VARIABLES--------
# ------------------------
export ALGORIA=~/Documents/algoria
export EDITOR="nvim"
export GITHUB=~/Documents/code/github
export GOOGLE="$HOME/[email protected] - Google Drive/My Drive"
export ONEDRIVE="$HOME/OneDrive - ETS"
export VISUAL="nvim"
export sioyek="/Applications/sioyek.app/Contents/MacOS/"
export DOTFILES=~/Documents/code/github/dotfiles
export SCRIPTS=~/Documents/code/github/bash-script
export GEM_HOME=$HOME/gems
export UNI=~/Documents/universite
# vim mode
set -o vi
# REMOVE MACOS WARNING FOR BASH AND EXPORT PATH
if [ "$(uname)" = "Darwin" ]; then
eval "$(/opt/homebrew/bin/brew shellenv)" # add homebrew to path
export BASH_SILENCE_DEPRECATION_WARNING=1
# export PATH="$HOME/gems/bin:$HOME/.rbenv/bin:/opt/homebrew/opt/openjdk/bin:/opt/homebrew/bin/pip3:$PATH"
export PATH="/opt/homebrew/bin/pip3:/Users/lgbr/.cargo/bin:$PATH"
fi
export PKG_CONFIG_PATH="/opt/homebrew/opt/readline/lib/pkgconfig"
export OpenMP_ROOT=$(brew --prefix)/opt/libomp # for gti320 lab
source ~/.env/bin/activate
# --------------------
# -------ALIAS--------
# --------------------
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
# fzf
eval "$(fzf --bash)"
# --------------------
# ---AUTOCOMPLETION---
# --------------------
# git autocompletion
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
# Load Angular CLI autocompletion.
source <(ng completion script)
fi
# pomo autocompletion
# complete -C pomo pomo
# -------------------
# ------COLORS-------
# -------------------
RESET="\[\e[0m\]"
DEF="\[\e[39m\]"
BLACK="\[\e[30m\]"
BRIGHT_BLACK="\[\e[90m\]"
RED="\[\e[31m\]"
GREEN="\[\e[32m\]"
YELLOW="\[\e[33m\]"
BLUE="\[\e[34m\]"
MAGENTA="\[\e[35m\]"
CYAN="\[\e[36m\]"
WHITE="\[\e[37m\]"
BRIGHT_WHITE="\[\e[97m\]"
DARK_GREY="\[\e[90m\]"
LIGHT_RED="\[\e[91m\]"
LIGHT_GREEN="\[\e[92m\]"
LIGHT_YELLOW="\[\e[93m\]"
BOLD="\[\e[1m\]"
DARK=$BRIGHT_BLACK
# CUSTOM PROMPT
__ps1() {
local E="$?"
export PS1=""
if [ "$E" = "0" ]; then
PS1+="${GREEN}√${DARK} "
else
PS1+="${RED}?${E}${DARK} "
fi
# branch="$(git branch --show-current 2> /dev/null)"
# if [ "$branch" != "" ]; then
# # PS1+="(${YELLOW} ${branch}${DARK}) "
# PS1+="(${YELLOW}${branch}${DARK}) "
# fi
# PS1+="${BOLD}${DARK}${PWD#"${PWD%/*/*/*}/"} "
if [ "$ENABLE_WATER_REMINDER" = "1" ]; then
PS1+="$(drink_water) ${BOLD}${DARK}${PWD#"${PWD%/*/*}/"}\$ ${RESET}"
else
PS1+="${BOLD}${DARK}${PWD#"${PWD%/*/*}/"}\$ ${RESET}"
fi
# PS1+="${RESET}\$ -> "
# PS1+="${RESET}\$ "
}
PROMPT_COMMAND="__ps1"
ENABLE_WATER_REMINDER=0
source ~/.bash_scripts