]> git.sthu.org Git - vimconf.git/blob - install.sh
Switch to official vim-clang repo
[vimconf.git] / install.sh
1 #!/bin/sh
2
3 set -e
4
5 check_vim()
6 {
7 if /usr/bin/vim --version | grep -q "$1"; then
8 echo "vim has support for $1."
9 else
10 echo "vim has no support for $1. Aborting."
11 exit
12 fi
13 }
14
15 check_py3()
16 {
17 if python3 -c "import $1" 2>/dev/null; then
18 echo "Python3 module '$1' exists."
19 else
20 echo "Python3 module '$1' missing. Aborting."
21 exit
22 fi
23 }
24
25 check_prog()
26 {
27 if which "$1" > /dev/null; then
28 echo "$1 found"
29 else
30 echo "$1 not found. Aborting."
31 exit
32 fi
33 }
34
35 check_requirements()
36 {
37 check_vim +python3
38 check_prog aspell
39 check_py3 neovim
40 }
41
42 install() {
43 echo "Installing files."
44 touch $HOME/.viminfo
45 ln -s $HOME/.vim/init.vim $HOME/.vimrc
46 ln -s $HOME/.vim/gvimrc $HOME/.gvimrc
47 ln -s $HOME/.vim $HOME/.config/nvim
48 }
49
50
51 check_requirements
52 install