forked from Bash-it/bash-it
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bash_it.sh
74 lines (60 loc) · 1.65 KB
/
bash_it.sh
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
#!/bin/bash
# Initialize Bash It
# Reload Library
alias reload='source ~/.bash_profile'
# Load the framework
# Load colors first so they can be use in base theme
source "${BASH}/themes/colors.theme.bash"
source "${BASH}/themes/base.theme.bash"
# Library
LIB="${BASH}/lib/*.bash"
for config_file in $LIB
do
source $config_file
done
# Tab Completion
COMPLETION="${BASH}/completion/*.bash"
for config_file in $COMPLETION
do
source $config_file
done
# Plugins
PLUGINS="${BASH}/plugins/enabled/*.bash"
for config_file in $PLUGINS
do
source $config_file
done
# Aliases
FUNCTIONS="${BASH}/aliases/*.bash"
for config_file in $FUNCTIONS
do
source $config_file
done
# Custom
CUSTOM="${BASH}/custom/*.bash"
for config_file in $CUSTOM
do
source $config_file
done
unset config_file
if [[ $PROMPT ]]; then
export PS1=$PROMPT
fi
# Adding Support for other OSes
PREVIEW="less"
[ -s /usr/bin/gloobus-preview ] && PREVIEW="gloobus-preview"
[ -s /Applications/Preview.app ] && PREVIEW="/Applications/Preview.app"
#
# Custom Help
function bash-it() {
echo "Welcome to Bash It!"
echo
echo "Here is a list of commands you can use to get help screens for specific pieces of Bash it:"
echo
echo " rails-help This will list out all the aliases you can use with rails."
echo " git-help This will list out all the aliases you can use with git."
echo " todo-help This will list out all the aliases you can use with todo.txt-cli"
echo " aliases-help Generic list of aliases."
echo " plugins-help This will list out all the plugins and functions you can use with bash-it"
echo
}