Skip to content

Instantly share code, notes, and snippets.

@ps
Created January 18, 2015 17:47
Show Gist options
  • Save ps/6ac0b69609661e3d8d6f to your computer and use it in GitHub Desktop.
Save ps/6ac0b69609661e3d8d6f to your computer and use it in GitHub Desktop.
Vim Skeleton Java Code
If you get tired of typing public class... and then the main method in vim
then here is your solution.
autocmd BufNewFile *.java
\ exe "normal Opublic class " . expand('%:t:r') . " {\npublic static void main(String [] args) {\n\n}\n}\<Esc>1G"
Just insert it into your '.vimrc' and that's it! The next time you open a brand new Java file you
will see a template.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment