-
Notifications
You must be signed in to change notification settings - Fork 0
/
bashrc
77 lines (61 loc) · 1.75 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
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
# Default prompt
#PS1='[\u@\h \W]\$ '
# get hostname for account-specific commands
host=`hostname | cut -d. -f1` # period for delimiter, first field
# Telsa server
if [ $host = "tesla" ]; then
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# use Anaconda3 python
export PATH=/usr/global/anaconda/bin:$PATH
# use python3 by default
source activate py3k
# use newer git version
module load git
else # local
export PATH=/home/toban/utilities/anaconda3/bin:$PATH
fi
#enable bash-completion, if available
[[ -f /usr/share/bash_completion ]] && source /usr/share/bash-completion/bash_completion
# enable tab-completion when using sudo
complete -cf sudo
# can install liquidprompt via AUR
# load Liquid Prompt: use commands prompt_on and prompt_off to toggle
# source liquidprompt
# enable readline's vi mode
set -o vi
#===================================
# ALIASES
#
# Toban pulled many of these from http://tldp.org/LDP/abs/html/sample-bashrc.html
#
#===================================
# -i for interactive. Prompts before overwriting/removing.
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias mkdir='mkdir -p' # automatically make parents
alias ls='ls -h --color=auto --group-directories-first'
alias ll='ls -Alv'
#===================================
# MAN PAGE COLORS
#
# Toban pulled this from https://wiki.archlinux.org/index.php/Man_page#Colored_man_pages
#
#===================================
man() {
env LESS_TERMCAP_mb=$'\E[01;31m' \
LESS_TERMCAP_md=$'\E[01;38;5;74m' \
LESS_TERMCAP_me=$'\E[0m' \
LESS_TERMCAP_se=$'\E[0m' \
LESS_TERMCAP_so=$'\E[38;5;246m' \
LESS_TERMCAP_ue=$'\E[0m' \
LESS_TERMCAP_us=$'\E[04;38;5;146m' \
man "$@"
}