blob: c27d303559bf186634fd8346c7744ab9353437ce (
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
[[ -f /etc/profile ]] && \
emulate sh -c 'source /etc/profile'
################## SET EDITOR #################
if [[ ! -z $(whence nvim) ]] then
export EDITOR=nvim
elif [[ ! -z $(whence vim) ]] then
export EDITOR=vim
elif [[ ! -z $(whence vi) ]] then
export EDITOR=vi
fi
############# STORE VIMTAGS IN TMP ############
export QT_STYLE_OVERRIDE=gtk
############# STORE VIMTAGS IN TMP ############
[[ -d /tmp/ ]] && \
touch /tmp/.vimtags && ln -sf /tmp/.vimtags .
############# INITIALISE CONFIGS ##############
[[ -f ~/.config/init/init.sh ]] && \
~/.config/init/init.sh
########## MAKE USER FUNCS AVAILABLE ##########
func_init_checkreq() {
local func_init_state=0
for e in "$@"; do
if [[ $func_init_state -eq 0 ]]; then
if [[ "$e" == ',' ]]; then
func_init_state=1
else
whence $e >/dev/null
[[ $? -eq 0 ]] || return 1
fi
else
local cmd
echo "$e" | read -A cmd
$cmd 2>/dev/null 1>&2
[[ $? -eq 0 ]] || return 1
fi
done
return 0
}
if [[ -d $HOME/.config/init/funcs/ && -d $HOME/.config/init/funcreqs ]]; then
rm -rf /tmp/funcs
mkdir -p /tmp/funcs
path+=(/tmp/funcs)
for f in $HOME/.config/init/funcreqs/*; do
source "$f"
func_init_checkreq $func_init_prereqs , $func_init_checks
if [[ $? -eq 0 ]] then
chmod +x $HOME/.config/init/funcs/${f:t}
ln -s $HOME/.config/init/funcs/${f:t} /tmp/funcs/${f:t}
fi
done
fi
############# CONNECTING OVER SSH #############
[[ -f $HOME/.zprofile-dtach ]] && \
source $HOME/.zprofile-dtach
export PATH
|