Browse Source

Submodules for vim plugins

master
Noah Petherbridge 5 years ago
parent
commit
d68e711e5a
2 changed files with 57 additions and 0 deletions
  1. +30
    -0
      .gitmodules
  2. +27
    -0
      make-submodules.py

+ 30
- 0
.gitmodules View File

@@ -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

+ 27
- 0
make-submodules.py View File

@@ -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()

Loading…
Cancel
Save