-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.bashrc
95 lines (73 loc) · 1.79 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
# .bashrc
function __source
{
while (( "$#" )); do
if [ -f "$1" ]; then
source "$1"
fi
shift
done
}
function __source_platform
{
local UNAME
local PLATFORM
# Source platform specific profile
UNAME=$(uname)
case $UNAME in
"")
;;
"Darwin")
PLATFORM=.osx
;;
"CYGWIN"*)
PLATFORM=.windows
;;
"MINGW"*)
PLATFORM=.windows
;;
*)
PLATFORM=."$(tr [A-Z] [a-z] <<< "$UNAME")"
;;
esac
__source "$HOME/$PLATFORM"
}
function __source_local
{
local HOSTNAME
if hostname --help 2>&1 | grep --no-messages --quiet "\-\-short"
then
HOSTNAME=$(hostname --short)
else
HOSTNAME=$(hostname | sed -e "s/\..*$//")
fi
__source "$HOME/.$HOSTNAME"
}
# Source global definitions
__source /etc/bashrc
# Source .profile, containing login, non-bash related initializations.
__source "$HOME/.profile"
# Enable programmable completion features.
__source /etc/bash_completion
# Sensible Bash
__source ~/dotfiles/bash-sensible/sensible.bash
export EDITOR=vim
# Avoid succesive duplicates in the bash command history.
export HISTCONTROL=ignoredups
# Case-insensitive globbing (used in pathname expansion)
shopt -s nocaseglob
# Append to the Bash history file, rather than overwriting it
shopt -s histappend
# Autocorrect typos in path names when using `cd`
shopt -s cdspell
# set the number of open files to be 1024
ulimit -S -n 1024
# Source .bash_aliases and .prompt
__source "$HOME/.bash_aliases" "$HOME/.prompt"
# Source .$PLATFORM, containing os\platform specific bash initializations.
__source_platform
# Source .$HOSTNAME, containing host specific bash initializations.
__source_local
unset __source
unset __source_platform
unset __source_local