From 813a42c895c51bdab2901e2ce2b589ef41285911 Mon Sep 17 00:00:00 2001 From: Ludovic Koenig Date: Tue, 2 Apr 2019 21:58:17 +0200 Subject: [PATCH 1/3] Add the syntax for Java The Java syntax is located under the ./after/syntax repository. The syntax provides mainly rules for methods, types and annotations. All syntax rules have the prefix 'javaOdyssey'. --- after/syntax/java.vim | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 after/syntax/java.vim diff --git a/after/syntax/java.vim b/after/syntax/java.vim new file mode 100644 index 0000000..d8c46bc --- /dev/null +++ b/after/syntax/java.vim @@ -0,0 +1,25 @@ +" _ ____ +" (_)____ _ _ __ ____ _ / __/____ _____ +" / // __ `/| | / // __ `/ / /_ / __ \ / ___/ +" / // /_/ / | |/ // /_/ / / __// /_/ // / +" __/ / \__,_/ |___/ \__,_/ /_/ \____//_/ +" /___/ __ +" ____ ____/ /__ __ _____ _____ ___ __ __ +" / __ \ / __ // / / // ___// ___// _ \ / / / / +" / /_/ // /_/ // /_/ /(__ )(__ )/ __// /_/ / +" \____/ \__,_/ \__, //____//____/ \___/ \__, / +" /____/ /____/ +" +" Java Syntax {{{ +syntax keyword javaOdysseyThis this +syntax match javaOdysseyClass "\%(\\s\+\)\@<=\<\u\w*\>" +syntax match javaOdysseyInterface "\%(\\s\+\)\@<=\<\u\w*\>" +syntax match javaOdysseyArray "\[\]" contained +syntax match javaOdysseyGeneric "[><]" contained +syntax match javaOdysseySeparator "," contained +syntax match javaOdysseyType "\%(\<\u\w*\>\%(<\%(\w\|,\|\s\|<\|>\)\+>\)\=\%(\[\]\)\=\)\%(\s*\<\l\w*\>\)\@=" containedin=javaParenT,javaParenT1,javaParenT2 contains=javaOdysseyGeneric,javaOdysseyArray,javaOdysseySeparator +syntax match javaOdysseyConstructor "\%(\<\u\w*\>\)\%(<\%(\w\|,\|\s\|<\|>\)\+>\)\=\%((\|\[\)"me=e-1 containedin=javaParenT,javaParenT1,javaParenT2 contains=javaOdysseyGeneric,javaOdysseySeparator +syntax match javaOdysseyMethod "\<\l\w*\>("me=e-1 containedin=javaParenT,javaParenT1,javaParenT2 +syntax match javaOdysseyCasting "(\<\u\w*\>\%(<\%(\w\|,\|\s\|<\|>\)\+>\)\=\%(\[\]\)\=)"hs=s+1,he=e-1 containedin=javaParenT,javaParenT1,javaParenT2 contains=javaOdysseyGeneric,javaOdysseyArray,javaOdysseySeparator +" }}} +" vim: foldmethod=marker From a19b91bfc676829c0e508fd1f725696a00a6b335 Mon Sep 17 00:00:00 2001 From: Ludovic Koenig Date: Tue, 2 Apr 2019 22:02:04 +0200 Subject: [PATCH 2/3] Add the highlights for Java Methods are colored in green, types in yellows and annotations in orange. Some italic flavours are also used. The most difficult thing to achieve was to highlight constantly Java types or classe names. --- colors/odyssey.vim | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/colors/odyssey.vim b/colors/odyssey.vim index 5326b27..6053066 100644 --- a/colors/odyssey.vim +++ b/colors/odyssey.vim @@ -256,6 +256,22 @@ call s:h( 'Ignore', 'background', 'background', 'none') call s:h( 'Error', 'background', 'error', 'bold') call s:h( 'Todo', 'background', 'warning', 'bold') +" }}} +" Java Highlights {{{ + +call s:h( 'javaAnnotation', 'background', 'warning', 'italic') +call s:l( 'javaExternal', 'Statement') +call s:l( 'javaTypeDef', 'javaOdysseyThis') +call s:l( 'javaOdysseyClass', 'Type') +call s:l( 'javaOdysseyInterface', 'Type') +call s:l( 'javaOdysseyCasting', 'Type') +call s:l( 'javaOdysseyArray', 'Normal') +call s:l( 'javaOdysseyGeneric', 'Normal') +call s:l( 'javaOdysseyType', 'Type') +call s:l('javaOdysseyConstructor', 'Type') +call s:l( 'javaOdysseyMethod', 'Function') +call s:l( 'javaOdysseyThis', 'Special') + " }}} " Ruby Highlights {{{ From 00fd7de50b3dd7c8ae9cd105cbce162a0216cb7c Mon Sep 17 00:00:00 2001 From: Ludovic Koenig Date: Tue, 2 Apr 2019 22:10:42 +0200 Subject: [PATCH 3/3] Modify the CHANGELOG.md file The CHANGELOG is modified to state the changes that have been introduced by the modifications for Java programming language. --- CHANGELOG.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6dd3b62..d1f442c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,8 +7,15 @@ project adheres to [Semantic Versioning]. ### Added +- Supports for the Java programming language have been added. The highlights + are achieved by reusing some existing pieces of syntax and by creating new + ones. Existing syntax groups have been remapped to other default syntax + groups and some new ones have been created for the occassion. + - Supports for the Ruby programming language have been added. Some highlights - of the existing syntax have been modified to better fit the color scheme. + of the existing syntax have been modified to better fit the color scheme. In + other words, some existing Ruby syntax groups have been linked to other + default syntax groups. ### Changed