-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.bashlib
More file actions
70 lines (58 loc) · 1.79 KB
/
.bashlib
File metadata and controls
70 lines (58 loc) · 1.79 KB
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
#!/usr/bin/env bash
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# typo correction for bash
shopt -s cdspell
if [[ ! "${BASH_VERSION:0:3}" < "4.2" ]]; then
shopt -s dirspell
fi
if [[ -f "$HOME"/.bash_features ]]; then
. "$HOME"/.bash_features
fi
# Alias definitions
if [[ -f "$HOME"/.bash_aliases ]]; then
. "$HOME"/.bash_aliases
fi
## include the bash libraries ##
################################
for lib in "$HOME"/.bash_lib.d/*; do
. "$lib"
done
## set up bash completion ##
############################
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
set completion-ignore-case on
for prog in "$HOME"/.bash_completion.d/*; do
. "$prog"
done
if [ -f "$HOME"/.bash_prompt ]; then
. "$HOME"/.bash_prompt
fi
# this loads a well known bashrc based on the REMOTE_USER env variable
# the recommended use of this is to serve as a dispatching script on shared servers
#
# the expected location is .bash_users.d/$REMOTE_USER.bash
#
# To set the REMOTE_USER envvar, you need to turn on PermitUserEnvironment in your sshd,
# and add `environment="REMOTE_USER=steven"` before the related key in ~/.ssh/authorized_keys
#
# PuTTY users can set the REMOTE_USER envvar via the Connection > Data settings,
# but sshd must have the "AllowEnv REMOTE_USER" line added to sshd_config.
if [[ -n "$REMOTE_USER" ]]; then
if [[ -f "$HOME/.bash_users.d/$REMOTE_USER.bash" ]]; then
. "$HOME/.bash_users.d/$REMOTE_USER.bash"
fi
fi
if [[ -n "$TMUX" ]]; then
if [[ -f "$HOME/.tmux_profile" ]]; then
. "$HOME/.tmux_profile"
fi
fi