Also:
- Restore the capability to mark as an error braces nested
in parens with g:javaInParen.
- Try not to fold top-level-type bodies. (Defining multiple
package-private top level types in a single source file is
not recommended as it can impose order among compilation
units; so it is assumed that only one such top level type
is usually defined.)
- Compose ‘method header’ highlighting and block braces
folding.
- Do not highlight block braces whenever ‘method header’
highlighting is requested.
This bundling of ‘method headers’ and block braces for
highlighting can be traced back to Vim v5.0; however, no
comment or documentation entry conveys any justification.
For example, it is hard to discover the connection between
block braces for "while", "if", etc., statements and method
body block braces. The former behaviour can be attained in,
e.g. ~/.vim/after/syntax/java.vim:
------------------------------------------------------------
if exists("g:java_highlight_functions")
syn clear javaBlock javaInParen
syn match javaBlockOther "[{}]"
syn region javaBlock transparent matchgroup=javaBlockStart
\ start="\%(^\|^\S[^:]\+\)\@120<!{" end="}" fold
hi def link javaBlockStart javaFuncDef
hi def link javaBlockOther javaBlockStart
if exists("g:java_mark_braces_in_parens_as_errors")
syn match javaInParen contained "[{}]"
endif
endif
------------------------------------------------------------
Note: Read ‘a method header omitting a _throws_ clause’ for
every ‘method header’ appellation used above.
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This directory contains Vim scripts for syntax highlighting.
These scripts are not for a language, but are used by Vim itself:
syntax.vim Used for the ":syntax on" command. Uses synload.vim.
manual.vim Used for the ":syntax manual" command. Uses synload.vim.
synload.vim Contains autocommands to load a language file when a certain
file name (extension) is used. And sets up the Syntax menu
for the GUI.
nosyntax.vim Used for the ":syntax off" command. Undo the loading of
synload.vim.
The "shared" directory contains generated files and what is used by more than
one syntax.
A few special files:
2html.vim Converts any highlighted file to HTML (GUI only).
colortest.vim Check for color names and actual color on screen.
hitest.vim View the current highlight settings.
whitespace.vim View Tabs and Spaces.
If you want to write a syntax file, read the docs at ":help usr_44.txt".
If you make a new syntax file which would be useful for others, please send it
to the vim-dev mailing list <vim-dev@vim.org>. Include instructions for
detecting the file type for this language, by file name extension or by
checking a few lines in the file. And please write the file in a portable way,
see ":help 44.12".
If you have remarks about an existing file, send them to the maintainer of
that file. Only when you get no response send a message to the vim-dev
mailing list: <vim-dev@vim.org>.
If you are the maintainer of a syntax file and make improvements, send the new
version to the vim-dev mailing list: <vim-dev@vim.org>
For further info see ":help syntax" in Vim.