diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2014-06-11 23:29:23 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2014-06-11 23:29:23 +0100 |
| commit | dac5e89e140541492618aeaa896df62f4d4f62ad (patch) | |
| tree | 057933b0aab686f77ea1fd9d5f390b977373b803 /rc/cpp.kak | |
| parent | 0faf7ff5e609a7b3fcf17586066f986460385fce (diff) | |
Add MultiRegionHighlighter
MultiRegionHighlighter provides a way to segment the buffer in
logical regions using the common left-most rule for finding the
next region. It then provides highlighting groups for each region
that can be filled.
Diffstat (limited to 'rc/cpp.kak')
| -rw-r--r-- | rc/cpp.kak | 22 |
1 files changed, 12 insertions, 10 deletions
@@ -40,19 +40,21 @@ def -hidden _cpp_indent_on_closing_curly_brace %[ ] defhl cpp -addhl -def-group cpp regex "\<(this|true|false|NULL|nullptr|)\>|\<-?\d+[fdiu]?|'((\\.)?|[^'\\])'" 0:value -addhl -def-group cpp regex "\<(void|int|char|unsigned|float|bool|size_t)\>" 0:type -addhl -def-group cpp regex "\<(while|for|if|else|do|switch|case|default|goto|break|continue|return|using|try|catch|throw|new|delete|and|or|not|operator|explicit)\>" 0:keyword -addhl -def-group cpp regex "\<(const|mutable|auto|namespace|inline|static|volatile|class|struct|enum|union|public|protected|private|template|typedef|virtual|friend|extern|typename|override|final)\>" 0:attribute -addhl -def-group cpp regex "^\h*?#.*?(?<!\\)$" 0:macro -addhl -def-group cpp region string %{(?<!')"} %{(?<!\\)(\\\\)*"} -addhl -def-group cpp/string/content fill string +addhl -def-group cpp multi_region -default code root \ + string %{(?<!')"} %{(?<!\\)(\\\\)*"} '' \ + comment /\* \*/ '' -addhl -def-group cpp region comment /\* \*/ -addhl -def-group cpp/comment/content fill comment +addhl -def-group cpp/root/string fill string +addhl -def-group cpp/root/comment fill comment -addhl -def-group cpp regex "(//[^\n]*\n)" 0:comment +addhl -def-group cpp/root/code regex "\<(this|true|false|NULL|nullptr|)\>|\<-?\d+[fdiu]?|'((\\.)?|[^'\\])'" 0:value +addhl -def-group cpp/root/code regex "\<(void|int|char|unsigned|float|bool|size_t)\>" 0:type +addhl -def-group cpp/root/code regex "\<(while|for|if|else|do|switch|case|default|goto|break|continue|return|using|try|catch|throw|new|delete|and|or|not|operator|explicit)\>" 0:keyword +addhl -def-group cpp/root/code regex "\<(const|mutable|auto|namespace|inline|static|volatile|class|struct|enum|union|public|protected|private|template|typedef|virtual|friend|extern|typename|override|final)\>" 0:attribute +addhl -def-group cpp/root/code regex "^\h*?#.*?(?<!\\)$" 0:macro + +addhl -def-group cpp/root/code regex "(//[^\n]*\n)" 0:comment hook global WinSetOption filetype=cpp %[ addhl ref cpp |
