From 4d369d6290c0ee18cb3fdf17a5bdb2a9580478d3 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 17 Sep 2012 19:02:08 +0200 Subject: [PATCH] kakrc: use color aliases for cpp and kakrc highlighting --- src/kakrc | 11 +++++++++++ src/rc/cpp.kak | 14 +++++++------- src/rc/kakrc.kak | 12 ++++++------ 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/src/kakrc b/src/kakrc index c5e053ca..0115b52c 100644 --- a/src/kakrc +++ b/src/kakrc @@ -20,3 +20,14 @@ def -shell-params runtime %{ %sh{ done fi } + +# define color scheme +colalias value red +colalias type yellow +colalias identifier cyan +colalias string magenta +colalias error default,red +colalias keyword blue +colalias attribute green +colalias comment cyan +colalias macro magenta diff --git a/src/rc/cpp.kak b/src/rc/cpp.kak index 93f7ccba..ff5bead2 100644 --- a/src/rc/cpp.kak +++ b/src/rc/cpp.kak @@ -11,13 +11,13 @@ hook global BufOpen .* %{ %sh{ hook global WinSetOption filetype=cpp %{ addhl group cpp-highlight - addhl -group cpp-highlight regex "\<(this|true|false|NULL|nullptr|)\>|\<-?\d+[fdiu]?|'((\\.)?|[^'\\])'" 0:red - addhl -group cpp-highlight regex "\<(void|int|char|unsigned|float|bool|size_t)\>" 0:yellow - 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)\>" 0:blue - addhl -group cpp-highlight regex "\<(const|auto|namespace|inline|static|volatile|class|struct|enum|union|public|protected|private|template|typedef|virtual|friend|extern|typename)\>" 0:green - addhl -group cpp-highlight regex "(?|\<-?\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)\>" 0:keyword + addhl -group cpp-highlight regex "\<(const|auto|namespace|inline|static|volatile|class|struct|enum|union|public|protected|private|template|typedef|virtual|friend|extern|typename)\>" 0:attribute + addhl -group cpp-highlight regex "(? 0:green - addhl -group kak-highlight regex \<(default|black|red|green|yellow|blue|magenta|cyan|white)\> 0:yellow - addhl -group kak-highlight regex (?<=\ 0:value + addhl -group kak-highlight regex (?<=\