Permalink
Browse files

add java support

  • Loading branch information...
1 parent 1f1be0e commit a96b93e5e2b5324c8bfa948cd3e526d8ae5d1d8c @jwu jwu committed Mar 22, 2012
Showing with 32 additions and 1 deletion.
  1. +1 −1 .vimrc
  2. +31 −0 vimfiles/after/syntax/java.vim
View
2 .vimrc
@@ -542,7 +542,7 @@ endif
" ------------------------------------------------------------------
" Disable auto-comment for c/cpp, lua, javascript, c# and vim-script
-au FileType c,cpp,javascript set comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,f://
+au FileType c,cpp,java,javascript set comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,f://
au FileType cs set comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,f:///,f://
au FileType vim set comments=sO:\"\ -,mO:\"\ \ ,eO:\"\",f:\"
au FileType lua set comments=f:--
View
31 vimfiles/after/syntax/java.vim
@@ -0,0 +1,31 @@
+" ======================================================================================
+" File : java.vim
+" Author : Wu Jie
+" Last Change : 03/22/2012 | 16:21:41 PM | Thursday,March
+" Description :
+" ======================================================================================
+
+"/////////////////////////////////////////////////////////////////////////////
+" syntax defines
+"/////////////////////////////////////////////////////////////////////////////
+
+if !exists('g:ex_todo_keyword')
+ let g:ex_todo_keyword = 'NOTE REF EXAMPLE'
+endif
+if !exists('g:ex_comment_lable_keyword')
+ let g:ex_comment_lable_keyword = 'TEMP CRASH MODIFY DEBUG DUMMY DELME TESTME OPTME REFACTORING DUPLICATE REDUNDANCY'
+endif
+silent exec ':syn keyword csTodo contained ' . g:ex_todo_keyword
+silent exec ':syn keyword exCommentLable contained ' . g:ex_comment_lable_keyword
+
+syn region javaComment start="/\*" end="\*/" contains=@javaCommentSpecial,javaTodo,@Spell,exCommentLable
+syn match javaLineComment "//.*" contains=@javaCommentSpecial2,javaTodo,@Spell,exCommentLable
+
+"/////////////////////////////////////////////////////////////////////////////
+" finish
+"/////////////////////////////////////////////////////////////////////////////
+
+let b:current_syntax = "java"
+
+" vim: ts=8
+

0 comments on commit a96b93e

Please sign in to comment.