-
Notifications
You must be signed in to change notification settings - Fork 0
/
bash_profile
63 lines (52 loc) · 1.53 KB
/
bash_profile
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
# vim: set ft=sh:
# Don't run any of this if we're starting a desktop environment (and non-interactive and login
# shell)
if [[ $- != *i* ]] && shopt -q login_shell && [[ $DESKTOP_SESSION ]]; then
return
fi
# Sort a list of files by base name.
sort_files()
{
printf "%s\n" "$@" | paste <(printf "%s\n" "$@" | awk -F/ '{print $NF}') - | sort -k1,1 | cut -f2
}
# This should only be sourced once.
if [[ $PROFILE_SOURCED ]]; then
# But still we need to ensure that .bashrc is sourced.
if [[ -z $BASHRC_SOURCED ]]; then
. $HOME/.bashrc
fi
return
fi
export PROFILE_SOURCED=true
# export PROFILING=true
if [[ $PROFILING == true ]]; then
# Add profiling code.
PS4='+ $(date "+%s.%N")\011 '
exec 3>&2 2>/tmp/bashstart.$$.log
set -x
fi
# For pipx.
export PATH="$PATH:$HOME/.local/bin"
export PATH="$HOME/.bin:$HOME/.bin.local:$PATH"
if hash nvim 2> /dev/null; then
export EDITOR="/usr/bin/env nvim"
else
export EDITOR="/usr/bin/env vim"
fi
export GIT_EDITOR=$EDITOR
export RIPGREP_CONFIG_PATH=$HOME/.ripgreprc
# Source files from ~/.bashrc.d{,.local}.
for file in $(sort_files ~/.bash_profile.d/* ~/.bash_profile.d.local/*); do
[[ ! -f $file ]] || . $file
done
# If we haven't already sourced .bashrc, source it.
if [[ -z $BASHRC_SOURCED ]]; then
. $HOME/.bashrc
fi
export LANG=en_GB.UTF-8
export LC_ALL=en_GB.UTF-8
# Must be at the end of the file to work.
if [[ -d ~/.sdkman ]]; then
export SDKMAN_DIR=~/.sdkman
[[ -s $SDKMAN_DIR/bin/sdkman-init.sh ]] && . "$SDKMAN_DIR/bin/sdkman-init.sh"
fi