-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbashrc
33 lines (26 loc) · 769 Bytes
/
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
# Colouring of the terminal
PROMPT_COMMAND=__prompt_command # Func to gen PS1 after CMDs
__prompt_command() {
local EXIT="$?" # This needs to be first
PS1=""
local RCol='\[\e[0m\]'
local Red='\[\e[0;31m\]'
local Gre='\[\e[0;32m\]'
local BYel='\[\e[1;33m\]'
local BBlu='\[\e[1;34m\]'
local Pur='\[\e[0;35m\]'
if [ $EXIT != 0 ]; then
PS1+="${Red}\u${RCol}" # Add red if exit code non 0
else
PS1+="${Gre}\u${RCol}"
fi
PS1+="${RCol}@${BBlu}\h:${BYel}\w${BYel} $ ${RCol}"
}
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
# Linux-like alias
alias xclip='pbcopy'
alias ls='ls -GFh'
alias ll='ls -lGFh'
alias g++='/usr/bin/g++ --std=c++1y'
alias rmswp='rm $(find -regex .*swp$)'