forked from pbondoer/vim-42header
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·79 lines (66 loc) · 2.29 KB
/
install.sh
File metadata and controls
executable file
·79 lines (66 loc) · 2.29 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
# **************************************************************************** #
# #
# |\ #
# install.sh ------| \---- #
# | \` \ | p #
# By: cshepard6055 <cshepard6055@floridapoly.edu> | \`-\ \ | o #
# |---\ \ `| l #
# Created: 2017/11/06 09:01:29 by cshepard6055 | ` .\ \ | y #
# Updated: 2017/12/04 08:42:14 by cshepard6055 ------------- #
# #
# **************************************************************************** #
# set vars
cr=`echo $'\n.'`
cr=${cr%.}
shell_config="$HOME/.$(which $SHELL | cut -c6-9)rc"
# in special case of bash
if [ $(which $SHELL) = "/bin/bash" ]
then
shell_config=".bashrc"
fi
# in special case of tcsh
if [ $(which $SHELL) = "/bin/tcsh" ]
then
shell_config=".tcshrc"
fi
echo "This installs pathogen for vim, and configures your header. "
while true; do
read -p "Do you wish to do this? [y/n] $cr" yn
case $yn in
[Yy]* ) break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no. ";;
esac
done
echo "Would you like to create a .vimrc? [y/n]"
read yn
if [ $yn = "Y" ] || [ $yn = "y" ]
then
touch ~/.vimrc
echo "Basic or complex? [b/c] "
read bc
fi
echo "execute pathogen#infect()" >> ~/.vimrc
# create or overwrite .vimrc
if [ $bc ]
then
if [ $bc = "C" ] || [ $bc = "c" ]
then
echo "If you have a .vimrc, it will be reset. (2 seconds)"
sleep 2
cp .vimrc ~/.vimrc
fi
fi
# install pathogen
mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
# install header
mkdir -p ~/.vim/plugin
cp plugin/poly-header.vim ~/.vim/plugin
touch $shell_config
# set $MAIL environment variable
read -p "Setting USER var. What is your poly username? e.g. jdoe1337 $cr" USER
echo "export MAIL=$USER@floridapoly.edu" >> $shell_config
echo "export USER=$USER" >> $shell_config
source $shell_config