-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbashrc.light
68 lines (59 loc) · 2.45 KB
/
bashrc.light
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
# ========================================================== #
# colors
# ========================================================== #
C_RST="\[\017\]\[\033[0m\]"
C_GRY="\[\033[1;30m\]"
C_RED="\[\033[31m\]"
C_GRN="\[\033[32m\]"
C_YLW="\[\033[33m\]"
C_BLU="\[\033[34m\]"
C_MAG="\[\033[35m\]"
C_CYN="\[\033[36m\]"
C_WHT="\[\033[37m\]"
# ========================================================== #
# get a color based on hostname + username
# ========================================================== #
PCOLS=($C_BLU $C_RED $C_CYN $C_YLW $C_MAG $C_GRN $C_WHT)
PCOLH=$(echo $USER@$(hostname) | sha1sum | cut -d" " -f1)
PCOLI=$(expr $((16#$PCOLH)) % 7)
C_COL=${PCOLS[$PCOLI]}
# ========================================================== #
# my prompt - color based on user/host - errno
# ========================================================== #
C_POK="${C_WHT}#${C_WHT}"
C_PNO="${C_RED}#${C_WHT}"
C_PRM="if [ \$? = 0 ]; then echo \"${C_POK}\"; else echo \"${C_PNO}\"; fi"
PS1="${C_RST}${C_COL}<${C_WHT}\u${C_COL}~${C_WHT}\H${C_COL}> ${C_GRN}\w \`${C_PRM}\` "
# ========================================================== #
# aliases
# ========================================================== #
export lopts='--color=auto'
eval "`dircolors`"
alias ls='ls $lopts'
alias ll='ls $lopts -l'
alias lla='ls $lopts -la'
alias lh='ls $lopts -lh'
alias la='ls $lopts -la'
alias grep='grep --color'
alias less='less -r'
alias ggg='gdb -ex=r --args'
alias hexsort="tr [a-f] [A-F] | awk ' { printf "%80s\n",$1 } ' | sort | awk ' { print $1 } ' "
alias webshare='python -m SimpleHTTPServer 8080'
alias splitwords="tr -s '[[:punct:][:space:]]' '\n'"
alias tolower="tr '[:upper:]' '[:lower:]'"
# ========================================================== #
# env
# ========================================================== #
export EDITOR=nano
export SHELL=bash
# ========================================================== #
# pager
# ========================================================== #
export PAGER='less -R'
export LESS_TERMCAP_mb=$'\e[01;31m' # begin blinking
export LESS_TERMCAP_md=$'\e[01;38;5;12m' # begin bold
export LESS_TERMCAP_me=$'\e[0m' # end mode
export LESS_TERMCAP_so=$'\e[30m\e[42m' # begin standout-mode - info box
export LESS_TERMCAP_se=$'\e[0m' # end standout-mode
export LESS_TERMCAP_us=$'\e[04;38;5;6m' # begin underline
export LESS_TERMCAP_ue=$'\e[0m' # end underline