-
Notifications
You must be signed in to change notification settings - Fork 0
/
bashrc
70 lines (56 loc) · 1.48 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
#
# .bashrc --- Shell initialization file for bash.
#
# Copyright (C) 2001-2013, James Bielman <[email protected]>
# All Rights Reserved.
#
## General Configuration
unset HISTFILE # turn off history file
export EDITOR=vim # default text editor
# Append a directory to "PATH" if it is not already there.
path_append()
{
if [ -d "$1" ] && [[ ":$PATH:" != *":$1:"* ]]; then
PATH="${PATH:+"$PATH:"}$1"
fi
}
# Set up a reasonable default PATH.
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
path_append $HOME/bin
## Interactive Shell Configuration
if [ -n "$PS1" ]; then
OS=`uname`
ulimit -c unlimited
if [ "$OS" == "Darwin" ]; then
if hash gls 2>/dev/null; then
alias ls="gls --color=auto -F -B"
fi
else
alias ls='ls --color=auto -F -B'
fi
if hash vim 2>/dev/null; then
alias vi=vim
fi
if [ "$TERM" == "dumb" ]; then
# Set an obviously correct prompt for Emacs tramp mode.
PS1="$ "
else
PS1='[\u@\h \[[1m\]\w\[[0m\]] '
fi
fi
## Package Configuration
# If the directory "$HOME/.bashrc.d" exists, source each file
# within it. This is used for per-package setup that will vary
# on different machines.
if [ -d $HOME/.bashrc.d ]; then
for f in $HOME/.bashrc.d/*; do
if [ -r $f ]; then
source $f
fi
done
fi
# If the file "$HOME/.bashrc_local" exists, source it.
if [ -r $HOME/.bashrc_local ]; then
source $HOME/.bashrc_local
fi
export PATH