Skip to content

Instantly share code, notes, and snippets.

@jameskyle
Created November 15, 2011 15:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jameskyle/1367364 to your computer and use it in GitHub Desktop.
Save jameskyle/1367364 to your computer and use it in GitHub Desktop.
Insert shebang at the top of new script files
augroup Shebang
au!
autocmd BufNewFile *.py 0put =\"#!/usr/bin/env python\<nl># -*- coding: iso-8859-15 -*-\<nl>\"|$
autocmd BufNewFile *.rb 0put =\"#!/usr/bin/env ruby\<nl># -*- coding: None -*-\<nl>\"|$
autocmd BufNewFile *.tex 0put =\"%&plain\<nl>\"|$
autocmd BufNewFile *.\(cc\|hh\) 0put =\"//\<nl>// \".expand(\"<afile>:t\").\" -- \<nl>//\<nl>\"|2|start!
augroup END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment