diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2013-12-03 22:15:59 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2013-12-03 22:15:59 +0000 |
| commit | c9eb65b04c140daa0688b0d80947c41391a083e6 (patch) | |
| tree | c9ef10bea5f0f5e5f73f5a0f609e33e45f8badfa /src/rc/cpp.kak | |
| parent | 45d5dbcc8566d54251302842d13d49cfd8f81780 (diff) | |
Change rc files to use shared highlighters
Diffstat (limited to 'src/rc/cpp.kak')
| -rw-r--r-- | src/rc/cpp.kak | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/rc/cpp.kak b/src/rc/cpp.kak index 708be8e8..552de1a8 100644 --- a/src/rc/cpp.kak +++ b/src/rc/cpp.kak @@ -37,15 +37,17 @@ def -hidden _cpp_indent_on_closing_curly_brace %[ try %[ exec -draft "hm<space><a-?>(class|struct)<ret><a-k>\`(class|struct)[^{}\n]+(\n)?\s*\{\'<ret><a-space>ma;<esc>" ] ] +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 regex "(?<!')\".*?(?<!\\)(\\\\)*\"" 0:string +addhl -def-group cpp regex "(//[^\n]*\n)|(/\*.*?(\*/|\'))" 0:comment + hook global WinSetOption filetype=cpp %[ - addhl group cpp-highlight - addhl -group cpp-highlight regex "\<(this|true|false|NULL|nullptr|)\>|\<-?\d+[fdiu]?|'((\\.)?|[^'\\])'" 0:value - addhl -group cpp-highlight regex "\<(void|int|char|unsigned|float|bool|size_t)\>" 0:type - addhl -group cpp-highlight 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 -group cpp-highlight 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 -group cpp-highlight regex "^\h*?#.*?(?<!\\)$" 0:macro - addhl -group cpp-highlight regex "(?<!')\".*?(?<!\\)(\\\\)*\"" 0:string - addhl -group cpp-highlight regex "(//[^\n]*\n)|(/\*.*?(\*/|\'))" 0:comment + addhl ref cpp # cleanup trailing whitespaces when exiting insert mode hook window InsertEnd .* -id cpp-hooks %{ try %{ exec -draft <a-x>s\h+$<ret>d } } @@ -56,7 +58,7 @@ hook global WinSetOption filetype=cpp %[ ] hook global WinSetOption filetype=(?!cpp).* %{ - rmhl cpp-highlight + rmhl cpp rmhooks window cpp-indent rmhooks window cpp-hooks } |
