Last active
February 12, 2018 07:50
-
-
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/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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