From d68e711e5a3a3e717878a96d71c0c140ef1277ee Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Fri, 5 Dec 2014 17:30:44 -0800 Subject: [PATCH] Submodules for vim plugins --- .gitmodules | 30 ++++++++++++++++++++++++++++++ make-submodules.py | 27 +++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 .gitmodules create mode 100644 make-submodules.py diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..016d473 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,30 @@ +[submodule "home/.vim/bundle/Vundle.vim"] + path = home/.vim/bundle/Vundle.vim + url = https://github.com/gmarik/Vundle.vim +[submodule "home/.vim/bundle/nerdtree"] + path = home/.vim/bundle/nerdtree + url = https://github.com/scrooloose/nerdtree +[submodule "home/.vim/bundle/vim-nerdtree-tabs"] + path = home/.vim/bundle/vim-nerdtree-tabs + url = https://github.com/jistr/vim-nerdtree-tabs +[submodule "home/.vim/bundle/vim-airline"] + path = home/.vim/bundle/vim-airline + url = https://github.com/bling/vim-airline +[submodule "home/.vim/bundle/tagbar"] + path = home/.vim/bundle/tagbar + url = https://github.com/majutsushi/tagbar +[submodule "home/.vim/bundle/molokai"] + path = home/.vim/bundle/molokai + url = https://github.com/tomasr/molokai +[submodule "home/.vim/bundle/ctrlp.vim"] + path = home/.vim/bundle/ctrlp.vim + url = https://github.com/kien/ctrlp.vim +[submodule "home/.vim/bundle/vim-coffee-script"] + path = home/.vim/bundle/vim-coffee-script + url = https://github.com/kchmck/vim-coffee-script +[submodule "home/.vim/bundle/vim-markdown"] + path = home/.vim/bundle/vim-markdown + url = https://github.com/tpope/vim-markdown +[submodule "home/.vim/bundle/editorconfig-vim"] + path = home/.vim/bundle/editorconfig-vim + url = https://github.com/editorconfig/editorconfig-vim diff --git a/make-submodules.py b/make-submodules.py new file mode 100644 index 0000000..2851403 --- /dev/null +++ b/make-submodules.py @@ -0,0 +1,27 @@ +#!/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 = re.search(r"Plugin '(\w+?)/([A-Za-z0-9.-]+?)'", line) + if match: + username = match.group(1) + repo = match.group(2) + path = "home/.vim/bundle/{}".format(repo) + url = "https://github.com/{}/{}".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. +vimrc.close() +outfh.close()