Add java code highlighting
This commit is contained in:
parent
f56b6ed75b
commit
7f35e92989
28
rc/java.kak
Normal file
28
rc/java.kak
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
hook global BufCreate .*\.java %{
|
||||||
|
set buffer filetype java
|
||||||
|
}
|
||||||
|
|
||||||
|
hook global BufSetOption mimetype=text/java %{
|
||||||
|
set buffer filetype java
|
||||||
|
}
|
||||||
|
|
||||||
|
addhl -group / regions -default code java \
|
||||||
|
string %{(?<!')"} %{(?<!\\)(\\\\)*"} '' \
|
||||||
|
comment /\* \*/ '' \
|
||||||
|
comment // $ ''
|
||||||
|
|
||||||
|
addhl -group /java/string fill string
|
||||||
|
addhl -group /java/comment fill comment
|
||||||
|
|
||||||
|
addhl -group /java/code regex %{\<(this|true|false|null)\>} 0:value
|
||||||
|
addhl -group /java/code regex "\<(void|int|char|unsigned|float|boolean|double)\>" 0:type
|
||||||
|
addhl -group /java/code regex "\<(while|for|if|else|do|static|switch|case|default|class|interface|goto|break|continue|return|import|try|catch|throw|new|package|extends|implements)\>" 0:keyword
|
||||||
|
addhl -group /java/code regex "\<(final|public|protected|private|abstract)\>" 0:attribute
|
||||||
|
|
||||||
|
hook global WinSetOption filetype=java %{
|
||||||
|
addhl ref java
|
||||||
|
}
|
||||||
|
|
||||||
|
hook global WinSetOption filetype=(?!java).* %{
|
||||||
|
rmhl java
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user