Created
April 26, 2011 03:28
-
-
Save dfm/941740 to your computer and use it in GitHub Desktop.
Python template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" TEMPLATES | |
function! LoadTemplate() | |
" load a template based on the file extension | |
silent! 0r ~/.vim/skel/tmpl.%:e | |
" Replace some placeholders | |
%s/%FILENAME%/\=expand("%:t")/g | |
%s/%DATE%/\=strftime("%b %d, %Y")/g | |
" This last one deletes the placeholder | |
" %START% then leaves the cursor there. | |
%s/%START%//g | |
endfunction | |
autocmd! BufNewFile * call LoadTemplate() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# encoding: utf-8 | |
""" | |
%FILENAME% | |
Created by <Your Name> on %DATE% | |
""" | |
import numpy as np | |
import pylab as pl | |
def main(): | |
%START% | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@dfm test