Skip to content

Instantly share code, notes, and snippets.

@pfandzelter
Forked from ps/gist:6ac0b69609661e3d8d6f
Last active August 29, 2015 14:19
Show Gist options
  • Save pfandzelter/b09be56789814f5ee332 to your computer and use it in GitHub Desktop.
Save pfandzelter/b09be56789814f5ee332 to your computer and use it in GitHub Desktop.
Java skeleton for vim
If you get tired of typing public class... and then the main method in vim
then here is your solution. This also includes a skeleton for class documentation (author and version) that is compliant with Javadoc guidelines.
autocmd BufNewFile *.java
\ exe "normal O/**\r*\r* @author: \r* @version: \r* \r*/\r\rpublic class " . expand('%:t:r') . "\r public static void main(String[] args){\r\r }\r}\<Esc>1G"
Just insert it into your '.vimrc' and that's it! The next time you create a brand new Java file with 'vim *.java' you
will see a template.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment