A proper header format in python is described here .
Using either VIM or a shell script, I would like to have the usual metadata (like __author__, __authors__, __contact__, __copyright__, __license__, __deprecated__, __date__ and __version__) added to the file header. SVN keywords would also be nice. Adding it to new files is the most relevant. Adding it to existing files is a bonus.
Ruslan’s Blog has a solution for Emacs. But I was unable to find a solution for Python.
Where has this been done for python without Emacs? VIM can copy text from one file to another like so , but maybe there is a nicer way.
I highly recommend the snipMate plugin. You can easily add new snips per file type, and they’re triggered by just typing a keyword and hitting tab, so for example you could just hit
and all the fields would be added, and you can easily tab through any that require being filled out on a per-file basis. There is even already a snippet called docs in the built-in python snippets (vimfiles/snippets/python.snippets) that looks like it fills out similar metadata for docstrings which you could easily modify for your purposes, here it is as an example of the snip format:
Dynamic entries are supported using backticks in your snip (Filename and g:snips_author as the default for tabbable entries 1 and 2 above). The date could be added with:
(from the snipMate help doc).