forked from Remz-Jay/vim-config
-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.sh
executable file
·82 lines (72 loc) · 2.42 KB
/
setup.sh
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
71
72
73
74
75
76
77
78
79
80
81
82
#!/usr/bin/env zsh
# Logging stuff.
e_header() { echo -e "\n\033[1m$@\033[0m"; }
e_success() { echo -e " \033[1;32m✔\033[0m $@"; }
e_error() { echo -e " \033[1;31m✖\033[0m $@"; }
e_arrow() { echo -e " \033[1;34m➜\033[0m $@"; }
main () {
# Take home dir as parameter for use in puppet script
local home
if [[ -z $1 ]]
then
home=${ZDOTDIR:-${HOME}}
else
home=$1
fi
# Get the directory in which the script resides
local dotfileDir=${0:a:h}
e_header "Creating symlinks..."
mkdir -p $dotfileDir/backup
setopt EXTENDED_GLOB
local ohMyGlob='^(.idea|.git*|.config|Background|bin|backup|Icon|IntelliJ|README*|Screenshots|setup.sh|tags)(D)'
for dir ('/' '/bin/' '/.config/'); do
mkdir -p ${home}${dir}
mkdir -p $dotfileDir/backup${dir}
for rcfile in ${dotfileDir}${dir}${~ohMyGlob}; do
local target="${home}${dir}${rcfile:t}"
[[ -a "${target}" ]] && mv "${target}" "$dotfileDir/backup/${dir}" 2>/dev/null
if [ $(uname) = Darwin ]; then
command ln -h -s -F "$rcfile" "${target}"
else
command ln -s "$rcfile" "${target}"
fi
done
done
e_header "Installing vim plugins..."
vim -S <(echo -e "PlugInst \n q \n q")
# e_header "Compiling command-t for current ruby version..."
# pushd $home/${PWD##*/}/.vim/plugged/command-t/ruby/command-t
# if command -v ruby > /dev/null 2>&1; then
# ruby extconf.rb
# if command -v make > /dev/null 2>&1; then
# make
# fi
# fi
# popd
#
# e_header "Installing tmux plugins..."
# pushd $home/${PWD##*/}/.tmux
# if command -v tmux > /dev/null 2>&1; then
# e_arrow We have tmux
# if command -v git > /dev/null 2>&1; then
# if [[ ! -d plugins/tpm ]]; then
# e_arrow Cloning tpm
# git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
# else
# e_arrow Tpm already installed, updating
# pushd plugins/tpm
# git pull
# popd
# fi
# fi
# fi
# popd
source $home/.config/zsh/0_functions.zsh
e_header "Concatenating .config/zsh files into single file..."
recreateCachedSettingsFile
e_header "Compiling zsh files for increased speed..."
compileAllTheThings
echo
e_success "All done!"
}
main "$1"