2014-11-22 20:13:50 +01:00
|
|
|
hook global BufCreate .*\.java %{
|
|
|
|
set buffer filetype java
|
|
|
|
}
|
|
|
|
|
2017-01-04 01:07:45 +01:00
|
|
|
add-highlighter -group / regions -default code java \
|
2014-11-22 20:13:50 +01:00
|
|
|
string %{(?<!')"} %{(?<!\\)(\\\\)*"} '' \
|
|
|
|
comment /\* \*/ '' \
|
|
|
|
comment // $ ''
|
|
|
|
|
2017-01-04 01:07:45 +01:00
|
|
|
add-highlighter -group /java/string fill string
|
|
|
|
add-highlighter -group /java/comment fill comment
|
2014-11-22 20:13:50 +01:00
|
|
|
|
2017-01-04 01:07:45 +01:00
|
|
|
add-highlighter -group /java/code regex %{\b(this|true|false|null)\b} 0:value
|
|
|
|
add-highlighter -group /java/code regex "\b(void|int|char|unsigned|float|boolean|double)\b" 0:type
|
|
|
|
add-highlighter -group /java/code regex "\b(while|for|if|else|do|static|switch|case|default|class|interface|goto|break|continue|return|import|try|catch|throw|new|package|extends|implements)\b" 0:keyword
|
|
|
|
add-highlighter -group /java/code regex "\b(final|public|protected|private|abstract)\b" 0:attribute
|
2014-11-22 20:13:50 +01:00
|
|
|
|
2017-01-04 01:07:45 +01:00
|
|
|
hook -group java-highlight global WinSetOption filetype=java %{ add-highlighter ref java }
|
|
|
|
hook -group java-highlight global WinSetOption filetype=(?!java).* %{ remove-highlighter java }
|