summaryrefslogtreecommitdiff
path: root/support/vim/install.sh
blob: 2a77b1b23cc30dcd36f5e9966ffa1e532ceeb90b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash

for type in {ftdetect,ftplugin,syntax}/stage.vim; do
	if [[ ! -e $type ]]; then
		echo "You don't seem to be in the right directory."
		echo "Run this from stage/support/vim"
		exit
	fi
done

if [[ $(whoami) != "root" ]]; then
	echo You should probably run this as root...
	exit
fi

for type in ftdetect ftplugin syntax; do
	for dest in /usr/share/vim/vim*; do
		if [[ ! -d $dest/$type ]]; then mkdir -v $dest/$type; fi
		if [[ -e $dest/$type/stage.vim ]]; then rm -v $dest/$type/stage.vim; fi
		cp -v $type/stage.vim $dest/$type
	done
done