#!/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