-
Notifications
You must be signed in to change notification settings - Fork 1
/
myvim
117 lines (91 loc) · 2.92 KB
/
myvim
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#!/bin/bash
# Make vim easier on Sean's eyes
# Sean Wingert August 25, 2017
# read-menu: a menu driven system information program
# read-validate: validate input
get_input () {
while :
do
clear
cat <<- EOF
Sean's myvim
------
Please Select:
1. Install plugins (vim-colors-solarized, vim-json, vim-log-syntax)
2. Uninstall plugins
3. List installed bundles
4. Edit .vimrc
5. Enable putty-colors-solarized
6. Disable putty-colors-solarized
7. Quit
Colors still not working? Either:
1. Download putty-colors-solarized (double-click a dark or light .reg and reload Putty)
2. Putty > Settings > Connection > Data > Terminal-type string: xterm-256color
EOF
read -n1 -p "Enter selection [1-6] : "
case "$REPLY" in
"1") do_install ;;
"2") do_uninstall ;;
"3") echo ; echo ; ls -lha ~/.vim/bundle ; echo ; read -p "End of listing" ;;
"4") [[ -s ~/.vimrc ]] && vim ~/.vimrc || printf "\n\n" && printf " NOTE: ~/.vimrc does not exist or is empty." && sleep 1.5 ;;
"5") palette="true" && do_uninstall && do_install ;;
"6") unset palette && do_uninstall && do_install ;;
"7") echo ; echo ; exit ;;
"q") echo ; echo ; exit ;;
esac
done
}
do_uninstall() {
#set -x
printf "\n\n"
echo "Remove pathogen"
rm -fv ~/.vim/autoload/pathogen.vim
echo
echo "Remove ~/.vimrc additions using sed"
sed -i '/" MYVIM_START/,/" MYVIM_END/d' ~/.vimrc
echo
echo "Remove mydiff"
rm -fv ~/.vim/bundle/mydiff
echo
echo "Remove solarized: " ~/.vim/bundle/vim-colors-solarized-master
rm -rfv ~/.vim/bundle/vim-colors-solarized
echo
echo "Remove vim-json: " ~/.vim/bundle/vim-json-master
rm -rfv ~/.vim/bundle/vim-json
echo
echo "Remove vim-log-syntax: " ~/.vim/bundle/vim-log-syntax-master
rm -rfv ~/.vim/bundle/vim-log4j
echo
read -p "Done"
}
do_install () {
echo
# check if already installed? TODO
# install git
yum -y install git
# install neovim
yum -y install epel-release
curl -o /etc/yum.repos.d/dperson-neovim-epel-7.repo \
https://copr.fedorainfracloud.org/coprs/dperson/neovim/repo/epel-7/dperson-neovim-epel-7.repo
yum -y install neovim
# install dein
curl https://raw.githubusercontent.com/Shougo/dein.vim/master/bin/installer.sh > installer.sh
sh ./installer.sh ~/.vim/bundles
# install ctags
yum -y install ctags
# install vundle
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
# for deoplete
sudo yum -y install python34-setuptools
sudo easy_install-3.4 pip
pip3 install --upgrade neovim
# download vimrc
curl -L https://github.com/seanw2020/.dotfiles/raw/master/.vimrc -o ~/.vimrc
# symlinks for neovim
mkdir -p ~/.config
ln -s ~/.vim ~/.config/nvim
ln -s ~/.vimrc ~/.config/nvim/init.vim
echo
read -p "Done installing"
}
get_input