From b277d9f3b453ea799de6b7f0cd8d404457b0e9ca Mon Sep 17 00:00:00 2001 From: Mal Date: Mon, 6 Jun 2022 00:35:53 +0200 Subject: [PATCH] C/C++ highlighting added --- cpp.nanorc | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 cpp.nanorc diff --git a/cpp.nanorc b/cpp.nanorc new file mode 100644 index 0000000..f59c38e --- /dev/null +++ b/cpp.nanorc @@ -0,0 +1,77 @@ +# +# MONOKAI like theme for C++ +# +# This theme uses extended colors of the gnome terminal. The standard command line +# may not reproduce the desired colors! +# +# A default gnome terminal theme could have unintended effects of the theme colors +# as well. Please use the default one! + +syntax javascript "\.(cpp|hpp|c|h)$" +comment "//" + +color white ".*" + +# Function or method calls +color cyan "\w+\(" + +# Function/method names on definitions +color green "@\w+" +color green "^[[:blank:]]+(\w+ )?\w+\(.*(\)| \{)$" + +color white "^[[:blank:]]+[a-zA-Z_0-9]+ " + +# Parameters inside method definitions +color orange "\([a-zA-Z_0-9,= '#:&]+\)( *\{|$)" +color white " \([a-zA-Z_0-9,= :&]+\)( *\{|$)" + +# Re-whitening parameter types +color white "(\(|, )[a-zA-Z:]+ " + +# Static method calls +color cyan "(^|[[:blank:]]|,|\(|=|\||&)[a-zA-Z_0-9]+::" +color white "::[a-zA-Z_0-9]+(::|$)" + +# Statements +color brightcyan "\<(class|struct|from|new|const|return|for|while|if|elseif|else|throw|continue|break|try|catch|switch|case|static|do)\>" + +# Special statements +color cyan "(public:|protected:|private:)" + +# Special values +color magenta "\<(true|false|null)\>" + +# Number values +color brightmagenta "[^a-zA-Z]([0-9]|[0-9]+\.?[0-9]+)[^a-zA-Z]" + +# "this" statement +color brightmagenta "(^|[[:blank:]]|\()this" + +# Re-whitening certain symbols +color white "(\(|\)|,|\.|\{|\}|;)" + +# Fixing re-whited . inside number +color brightmagenta "[0-9]+\.[0-9]+" + +# Operators +color red "(=|ยท|\/|\+|-|\*|\!|>|<|:|\?|&|\||%)" + +# Template type definition +color white "<[a-zA-Z0-9]+>" + +# Types +color brightcyan "\<(int|void|float|double|long|short|unsigned|bool|char)\>" + +# Strings +color yellow ""([^"\]|\\.)*"|'([^'\]|\\.)*'|`([^`\]|\\.)*`" + +# Comments +color grey "(^|[[:blank:]])//.*" +color grey start="/\*" end="\*/" + +# Redundant spaces +color ,brightred "[[:space:]]+$" + +# Preprocessor statements +color yellow "^#\w+ <[a-zA-Z\./]+>" +color brightmagenta "^#\w+"