From 6c0d572a612a3576550621d7ce958c0da2ab5dc6 Mon Sep 17 00:00:00 2001 From: Ludovic Koenig Date: Sat, 7 Sep 2019 15:05:38 +0200 Subject: [PATCH 1/2] Add some support to better highlight Rust It clears some Rust already existing syntax to better highlight the important language items. It then relinks some syntax to use the color scheme in a more efficient way, and it adds some support for types and functions. Those are the first for the Rust programming language. --- after/syntax/rust.vim | 40 ++++++++++++++++++++++++++++++++++++++++ colors/odyssey.vim | 6 ++++++ 2 files changed, 46 insertions(+) create mode 100644 after/syntax/rust.vim diff --git a/after/syntax/rust.vim b/after/syntax/rust.vim new file mode 100644 index 0000000..c9966b2 --- /dev/null +++ b/after/syntax/rust.vim @@ -0,0 +1,40 @@ +" __ ____ +" _____ __ __ _____ / /_ / __/____ _____ +" / ___// / / // ___// __/ / /_ / __ \ / ___/ +" / / / /_/ /(__ )/ /_ / __// /_/ // / +" /_/ \__,_//____/ \__/ /_/ \____//_/ +" __ +" ____ ____/ /__ __ _____ _____ ___ __ __ +" / __ \ / __ // / / // ___// ___// _ \ / / / / +" / /_/ // /_/ // /_/ /(__ )(__ )/ __// /_/ / +" \____/ \__,_/ \__, //____//____/ \___/ \__, / +" /____/ /____/ +" +" Note: This script aims at providing additional syntax for Rust. It only +" declares them or clears them. To be more precise, it clears some syntax +" because Odyssey is only a 12-colors scheme which implies that only some +" particular language items must be highlighted. Plus it provides more support +" for types and functions. +" +" Maintainer: Ludovic Koenig +" Version: 0.5.0 +" Since: 0.5.0 +" Licence: MIT +" +" Rust Syntax {{{ + +syntax clear rustModPath +syntax clear rustModPathSep +syntax clear rustTrait +syntax clear rustIdentifier +syntax clear rustFuncName +syntax clear rustFuncCall +syntax clear rustEnum +syntax clear rustEnumVariant +syntax clear rustOperator + +syntax match rustOdysseyFunction "\<\l\w*\>\%(\%(<\%(\w\|,\|'\|\s\)*>\)\=(\)\@=" +syntax match rustOdysseyType "\<\u\w*\>" + +" }}} +" vim: foldmethod=marker diff --git a/colors/odyssey.vim b/colors/odyssey.vim index d4baaba..1738dd8 100644 --- a/colors/odyssey.vim +++ b/colors/odyssey.vim @@ -302,5 +302,11 @@ call s:h( 'rubyInstanceVariable', 'background', 'warning', 'italic') call s:l('rubyInterpolationDelimiter', 'Function') call s:l( 'rubyStringDelimiter', 'Constant') +" }}} +" Rust Highlights {{{ +call s:l( 'rustLifetime', 'Constant') +call s:l( 'rustQuestionMark', 'Operator') +call s:l('rustOdysseyFunction', 'Function') +call s:l( 'rustOdysseyType', 'Type') " }}} " vim: foldmethod=marker From a2ee93148cc93996a763f19afb2f68e8603f53c8 Mon Sep 17 00:00:00 2001 From: Ludovic Koenig Date: Sat, 7 Sep 2019 15:12:49 +0200 Subject: [PATCH 2/2] Update the CHANGELOG with the last changes It closes #3 on Github. --- CHANGELOG.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f9d52c2..3863434 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,17 @@ project adheres to [Semantic Versioning]. ### Added -- It adds three Java syntax groups in order to be able to fold multiline +- Adds some supports for the Rust programming language: + + + Some already existing syntax groups have been cleared to provide + highlighting only for important items. + + + Some syntax groups have been linked to other highlight groups to beautify + the code. + + + Some new syntax groups for types and functions have been added. + +- Adds three Java syntax groups in order to be able to fold multiline comments, `import` statement blocks and `import static` statement blocks. ### Changed