Skip to content

Instantly share code, notes, and snippets.

@ps
Created January 18, 2015 17:47
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