forked from AdamWhittingham/adshell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustom
36 lines (32 loc) · 811 Bytes
/
custom
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
function source_if_present(){
local file="$1"
[[ -f $file ]] && source "$file"
}
CONFIG_BASE=$HOME/.mshell
# Load Customisations for all shells
source_if_present "$CONFIG_BASE/env"
source_if_present "$CONFIG_BASE/functions"
source_if_present "$CONFIG_BASE/aliases"
# Load Shell-specific customisations
if [[ -n $BASH ]] ; then
source_if_present "$CONFIG_BASE/bash/custom"
elif [[ -n $ZSH_NAME ]] ; then
source_if_present "$CONFIG_BASE/zsh/custom"
fi
if [[ -n $SSH_CONNECTION ]]; then
export EDITOR='vim'
else
case "$(uname)" in
"Darwin")
export EDITOR='nvim'
# Setup iTerm2 tab names
export PROMPT_COMMAND='echo -ne "\\033]0;$(basename ${PWD/#$HOME/~})\\007"'
;;
"Linux")
export EDITOR='gvim -f'
;;
*)
export EDITOR='vim'
;;
esac
fi