My Unix config files and shell scripts, optimized for Fedora, Debian, macOS and Windows (in that order).
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
732 B

#!/usr/bin/env python
"""Script to generate the .gitmodules file for the vim plugins."""
import re
# Open the files
vimrc = open("home/.vimrc", "r")
outfh = open(".gitmodules", "w")
for line in vimrc.readlines():
line = line.strip()
match ="Plugin '(\w+?)/([A-Za-z0-9.-]+?)'", line)
if match:
username =
repo =
path = "home/.vim/bundle/{}".format(repo)
url = "{}/{}".format(username, repo)
print "Submodule:", url
outfh.write("[submodule \"{}\"]\n".format(path))
outfh.write("\tpath = {}\n".format(path))
outfh.write("\turl = {}\n".format(url))
# Clean up.