aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/init/load-settings.sh
blob: 1990c1fb7a327e641ca8f1774621883b9ec0fb50 (plain)
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
if [[ $SHELL =~ zsh$ ]]; then
  setopt extended_glob
  fpath=($SETTING_DIR/zsh $fpath)
elif [[ $SHELL =~ bash$ ]]; then
  shopt -s extglob
fi

# set default editor
export EDITOR=vim

# load custom aliases
SETTING_DIR=${SETTING_DIR:=$HOME/settings}
source $SETTING_DIR/alias

# Add custom scripts into PATH
BIN_DIR=$HOME/bin
PATH=$PATH:$BIN_DIR
mkdir -p $BIN_DIR
find $BIN_DIR -xtype l | xargs rm 2>/dev/null || true

find $SETTING_DIR/tools -type f -executable | \
xargs realpath | xargs -I{} ln -sf {} $BIN_DIR

# load custom functions
OSM_UTIL_DIR=$SETTING_DIR/tools/osm
source $OSM_UTIL_DIR/osm

# sync with important git repos
$SETTING_DIR/tools/init/sync.sh

# go
PATH=$PATH:$HOME/go/bin

# android-studio
PATH=$PATH:$HOME/android-studio/bin

# cargo
PATH=$PATH:$HOME/.cargo/bin

# Run something after exit shell
trap 'exit.sh' EXIT