-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·103 lines (84 loc) · 2.6 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#!/usr/bin/env bash
delete_vim_files(){
echo "Removing '$HOME/.vimrc' file and '$HOME/.vim' directory"
rm -rf ~/.vim ~/.vimrc
}
create_vim_files(){
echo "Creating '$HOME/.vimrc' file and '$HOME/.vim' directory"
touch ~/.vimrc
echo "source ~/.vim/init.vim" >> ~/.vimrc
mkdir ~/.vim
}
echo "==== Prepare to install .vim ===="
echo "Check git..."
which git > /dev/null
if [ "$?" != "0" ]; then
echo "Oops... git was not found, install it before"
exit 1
else
echo "Ok"
fi
echo "Check vim..."
which vim > /dev/null
if [ "$?" != "0" ]; then
echo "Oops... vim was not found, install it before"
exit 1
else
echo "Ok"
fi
echo "Check curl..."
which curl > /dev/null
if [ "$?" != "0" ]; then
echo "Oops... curl was not found, install it before"
exit 1
else
echo "Ok"
fi
echo "Check cmake..."
which cmake > /dev/null
if [ "$?" != "0" ]; then
echo "Oops... cmake was not found, install it before"
exit 1
else
echo "Ok"
fi
if [ ! -f ~/.vimrc ] && [ ! -d ~/.vim ]; then
create_vim_files
else
echo
read -p "Replace your '$HOME/.vimrc' and '$HOME/.vim' directory? (y/n): " RESP
if [ "$RESP" = "y" ]; then
delete_vim_files
create_vim_files
else
echo "Ok, let's finish some other time"
exit 1
fi
fi
if [ ! -d ~/.config/nvim ]; then
if [ ! -d ~/.config ]; then
mkdir ~/.config
fi
ln -s ~/.vim ~/.config/nvim
fi
git clone https://github.com/gmist/.vim.git ~/.vim
echo
read -p "Install spell checker dictionaries? (y/n): " RESP
if [ "$RESP" = "y" ]; then
if [ ! -d ~/.vim/spell ]; then
mkdir -p ~/.vim/spell
fi
curl ftp://ftp.vim.org/pub/vim/runtime/spell/en.utf-8.spl > ~/.vim/spell/en.utf-8.spl
curl ftp://ftp.vim.org/pub/vim/runtime/spell/en.utf-8.sug > ~/.vim/spell/en.utf-8.sug
curl ftp://ftp.vim.org/pub/vim/runtime/spell/en.ascii.spl > ~/.vim/spell/en.ascii.spl
curl ftp://ftp.vim.org/pub/vim/runtime/spell/en.ascii.sug > ~/.vim/spell/en.ascii.sug
curl ftp://ftp.vim.org/pub/vim/runtime/spell/en.latin1.spl > ~/.vim/spell/en.latin1.spl
curl ftp://ftp.vim.org/pub/vim/runtime/spell/es.latin1.sug > ~/.vim/spell/en.latin1.sug
curl ftp://ftp.vim.org/pub/vim/runtime/spell/ru.cp1251.spl > ~/.vim/spell/ru.cp1251.spl
curl ftp://ftp.vim.org/pub/vim/runtime/spell/ru.cp1251.sug > ~/.vim/spell/ru.cp1251.sug
curl ftp://ftp.vim.org/pub/vim/runtime/spell/ru.koi8-r.spl > ~/.vim/spell/ru.koi8-r.spl
curl ftp://ftp.vim.org/pub/vim/runtime/spell/ru.koi8-r.sug > ~/.vim/spell/ru.koi8-r.sug
curl ftp://ftp.vim.org/pub/vim/runtime/spell/ru.utf-8.spl > ~/.vim/spell/ru.utf-8.spl
curl ftp://ftp.vim.org/pub/vim/runtime/spell/ru.utf-8.sug > ~/.vim/spell/ru.utf-8.sug
fi
vim