Skip to content

Instantly share code, notes, and snippets.

@kaushiksk
Last active February 12, 2018 07:50
Show Gist options
  • Save kaushiksk/48381494302de2b158ea7f083fd90a32 to your computer and use it in GitHub Desktop.
Save kaushiksk/48381494302de2b158ea7f083fd90a32 to your computer and use it in GitHub Desktop.
Script to add existing vim plugins as git submodules so that you can synchronise them as shown at: http://vimcasts.org/episodes/synchronizing-plugins-with-git-submodules-and-pathogen/
import os
import subprocess
HOME = "/home/kaushiksk/" # Change this to your home folder
os.chdir(HOME + ".vim/")
bundle_folder = "./bundle/"
modules = os.listdir(bundle_folder)
for module in modules:
os.chdir(bundle_folder + module)
try:
out = subprocess.check_output(["git", "remote","-v"])
os.chdir(HOME + ".vim/")
subprocess.call(["git", "submodule", "add", out.split()[1], bundle_folder + module ])
print "Done adding ", module
except:
print "Leaving ", module, ". Not a git repository"
os.chdir(HOME + ".vim/")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment