-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.sh
executable file
·70 lines (62 loc) · 1.95 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
#!/bin/bash
# nerdtree: File System navigation in vim
# supertab: fun tab completion for vim.
# undotree: UI for vim's Undo Tree (as in 'control-z' kind of undo)
# tagbar: depends on http://ctags.sourceforge.net/
# vim-fugitive: Git integration with Vim
# vim-commentary: Quick commenting sections
vim_plugins="scrooloose/nerdtree.git ervandew/supertab.git mbbill/undotree.git majutsushi/tagbar.git"
vim_plugins="$vim_plugins tpope/vim-fugitive.git tpope/vim-commentary.git"
function installVimPlugins() {
echo 'Installing Vim Plugins...'
echo 'Install curl/pathogen'
#Install Pathogen
sudo apt-get install curl
mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
for i in $(sed -r 's/ /\n/g' <<< "$vim_plugins"); do
echo "git clone https://github.com/$i ~/.vim/bundle$(sed -r 's/[^\/]*(.*).git/\1/' <<< $i)"
git clone git@github.com:$i ~/.vim/bundle$(sed -r 's/[^\/]*(.*).git/\1/' <<< $i)
done
}
function installBashProfile() {
echo "source ~/.profile" >> ~/.bash_profile
source ~/.bash_profile
}
function installDotFiles() {
echo "Installing dotfiles"
#Copy dotfiles over.
cp .vimrc ~/.vimrc
cp .tmux.conf ~/.tmux.conf
cp .tmux.conf.local ~/.tmux.conf.local
cp .inputrc ~/.inputrc
cp .profile ~/.profile
}
if [ $# -eq 0 ]
then
printf "$0 parameters:\n\t--all -- Do errything (except --profile)\n"
printf "\t--vim -- install vim plugins\n"
printf "\t--files -- copy dotfiles into home dir\n"
printf "\t--profile -- 'echo \"source ~/.profile\" >> ~/.bash_profile'\n"
exit 1
fi
for param in "$@"
do
case $param in --all)
installVimPlugins
installDotFiles
;;
esac
case $param in --vim)
installVimPlugins
;;
esac
case $param in --profile)
installBashProfile
;;
esac
case $param in --files)
installDotFiles
;;
esac
done