#!/usr/bin/python # STEP 1, GLVS print 'STEP 1, GLVS' import subprocess as sp sp.call(['vim', '-c', 'GLVS', '-c', 'q']) # STEP 2, install downloaded plugins print 'STEP 2, install downloaded plugins' import os, os.path as path join = path.join VIM_DIR = path.expanduser('.vim/') GLVS_DIR = join(VIM_DIR, 'GetLatest') PLUGIN_DIR = join(VIM_DIR, 'plugin') for filename in os.listdir(GLVS_DIR): fullname = join(GLVS_DIR, filename) if filename.endswith('.vim'): print 'copying ' + fullname sp.call(['cp', fullname, PLUGIN_DIR]) sp.call(['rm', fullname]) elif filename.endswith('.zip'): print 'unzipping ' + fullname sp.call(['unzip', '-d', VIM_DIR, fullname]) sp.call(['rm', fullname]) elif filename.endswith('.tar.gz'): print 'unarchiving ' + fullname sp.call(['tar', '-C', VIM_DIR, '-xvzf', fullname]) sp.call(['rm', fullname]) elif filename.endswith('.tar.bz2'): print 'unarchiving ' + fullname sp.call(['tar', '-C', VIM_DIR, '-xvjf', fullname]) sp.call(['rm', fullname]) elif filename.endswith('.vba') or filename.endswith('.vba.gz') or filename.endswith('.vmb'): print 'executing ' + fullname sp.call(['vim', '-c', 'so %', fullname, '-c', 'q']) if filename.endswith('.vba.gz'): sp.call(['rm', fullname[:-3]]) else: sp.call(['rm', fullname]) else: print 'ignoring ' + fullname # STEP 3, helptags print 'STEP 3, helptags' sp.call(['vim', '-c', 'helptags' + join(VIM_DIR, 'doc'), '-c', 'q'])