-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·62 lines (46 loc) · 1.35 KB
/
setup.sh
File metadata and controls
executable file
·62 lines (46 loc) · 1.35 KB
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
#!/usr/bin/env bash
# Get User Info
echo -n "Fullname for the computer: "
read name
echo -n "Email for the computer: "
read email
shell_opt=$(basename $SHELL)
# Install Vundle
if [ ! -d ~/.vim/bundle/Vundle.vim ]; then
mkdir -p ~/.vim/bundle
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
fi
# Setup Vim Folder
mkdir -p ~/.vim/{swp,backup}
# Handle recursive symlink on folder
if [ -h ~/.git_template ]; then
rm ~/.git_template
fi
# Link in dotfiles
ln -sf $PWD/vimrc ~/.vimrc
ln -sf $PWD/tmux.conf ~/.tmux.conf
ln -sf $PWD/ctags ~/.ctags
ln -sf $PWD/git_template ~/.git_template
# Create link for universal ctags
mkdir -p ~/.ctags.d
ln -sf $PWD/ctags ~/.ctags.d/main.ctags
# Install Vim Plugins
vim +PluginInstall +qall
# Setup the gitconfig
cp gitconfig ~/.gitconfig
git config --global user.name $name
git config --global user.email $email
if [ -f ./setup.$shell_opt ]; then
source ./setup.$shell_opt
fi
# Generate .setup.local
# Generate warning on modifications to file
echo '# This file is generated by setup.sh, DO NOT MODIFY' > ~/.setup.local
# Copy in all machine config
cat setup.all.local >> ~/.setup.local
# Run host-specific configuration
if [ -f ./setup.host-$(hostname).sh ]; then
. ./setup.host-$(hostname).sh
fi
touch ~/.setup.manual.local
echo 'source ~/.setup.manual.local' >> ~/.setup.local