-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·80 lines (65 loc) · 1.97 KB
/
install.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
#!/bin/bash
echo "Deprecated. Just run ./link_vim.sh"
exit 1
# Backup .dotfiles
echo "**** Backing up .dotfiles directory."
if [ -d ~/.dotfiles ]; then
#tar -zcvf "~/dotfiles-backup-$(date +"%Y-%m-%d").tar.gz" ~/.dotfiles
cp -rf ~/.dotfiles ~/.dotfiles.$(date +"%Y-%m-%d")
rm -rf ~/.dotfiles
fi
# Create .dotfiles directory if not exists
echo "**** Creating .dotfiles directory."
[ -d ~/.dotfiles ] || mkdir ~/.dotfiles
# Clone repo
echo "**** Cloning vim config repo."
git clone https://github.com/miguelmota/vim-config.git ~/.dotfiles/.vim
# Create backup directory
echo "**** Creating backup directory."
[ -d ~/.dotfiles/.vim/backup ] || mkdir ~/.dotfiles/.vim/backup
# Create symlinks
echo "**** Creating symbolic links."
ln -snf ~/.dotfiles/.vim ~/.vim
ln -snf ~/.dotfiles/.vim/vimrc ~/.vimrc
ln -snf ~/.dotfiles/.vim/viminfo ~/.viminfo
# Install Vundle bundle manager
if [[ ! -e ~/.vim/bundle/vundle/.git ]]; then
echo "**** Cloning Vundle bundle."
git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
fi
# Install ctags
if ! type ctags > /dev/null; then
echo "**** Installing ctags."
if [ "$(uname)" == "Darwin" ]; then
brew install ctags
fi
if [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
if grep -q "Ubuntu" /etc/os-release; then
sudo apt-get install exuberant-ctags
fi
fi
fi
# Install tern dependencies
if ! type npm > /dev/null; then
echo "**** Installing tern dependencies."
echo "** Installing nodejs."
if [ "$(uname)" == "Darwin" ]; then
brew install nodejs
fi
if [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
sudo apt-get install nodejs
echo "** Installing npm."
sudo apt-get install npm
fi
fi
# Install bundles
echo "**** Installing bundles (this may take a while)."
#vim +BundleInstall +qall 2&> /dev/null
vim +BundleInstall
# Install term
echo "**** Installing tern."
npm config set registry http://registry.npmjs.org/
#cd ~/.vim/bundle/tern_for_vim
#npm install
echo "**** Done."
exit 0;