My Unix config files and shell scripts, optimized for Fedora, Debian, macOS and Windows (in that order).
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 
 

28 wiersze
732 B

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