Browse Source

Submodules for vim plugins

Noah Petherbridge 4 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 @@
1
+[submodule "home/.vim/bundle/Vundle.vim"]
2
+	path = home/.vim/bundle/Vundle.vim
3
+	url = https://github.com/gmarik/Vundle.vim
4
+[submodule "home/.vim/bundle/nerdtree"]
5
+	path = home/.vim/bundle/nerdtree
6
+	url = https://github.com/scrooloose/nerdtree
7
+[submodule "home/.vim/bundle/vim-nerdtree-tabs"]
8
+	path = home/.vim/bundle/vim-nerdtree-tabs
9
+	url = https://github.com/jistr/vim-nerdtree-tabs
10
+[submodule "home/.vim/bundle/vim-airline"]
11
+	path = home/.vim/bundle/vim-airline
12
+	url = https://github.com/bling/vim-airline
13
+[submodule "home/.vim/bundle/tagbar"]
14
+	path = home/.vim/bundle/tagbar
15
+	url = https://github.com/majutsushi/tagbar
16
+[submodule "home/.vim/bundle/molokai"]
17
+	path = home/.vim/bundle/molokai
18
+	url = https://github.com/tomasr/molokai
19
+[submodule "home/.vim/bundle/ctrlp.vim"]
20
+	path = home/.vim/bundle/ctrlp.vim
21
+	url = https://github.com/kien/ctrlp.vim
22
+[submodule "home/.vim/bundle/vim-coffee-script"]
23
+	path = home/.vim/bundle/vim-coffee-script
24
+	url = https://github.com/kchmck/vim-coffee-script
25
+[submodule "home/.vim/bundle/vim-markdown"]
26
+	path = home/.vim/bundle/vim-markdown
27
+	url = https://github.com/tpope/vim-markdown
28
+[submodule "home/.vim/bundle/editorconfig-vim"]
29
+	path = home/.vim/bundle/editorconfig-vim
30
+	url = https://github.com/editorconfig/editorconfig-vim

+ 27
- 0
make-submodules.py View File

@@ -0,0 +1,27 @@
1
+#!/usr/bin/env python
2
+
3
+"""Script to generate the .gitmodules file for the vim plugins."""
4
+
5
+import re
6
+
7
+# Open the files
8
+vimrc = open("home/.vimrc", "r")
9
+outfh = open(".gitmodules", "w")
10
+
11
+for line in vimrc.readlines():
12
+    line = line.strip()
13
+    match = re.search(r"Plugin '(\w+?)/([A-Za-z0-9.-]+?)'", line)
14
+    if match:
15
+        username = match.group(1)
16
+        repo     = match.group(2)
17
+        path = "home/.vim/bundle/{}".format(repo)
18
+        url = "https://github.com/{}/{}".format(username, repo)
19
+        print "Submodule:", url
20
+
21
+        outfh.write("[submodule \"{}\"]\n".format(path))
22
+        outfh.write("\tpath = {}\n".format(path))
23
+        outfh.write("\turl = {}\n".format(url))
24
+
25
+# Clean up.
26
+vimrc.close()
27
+outfh.close()