From a737f17fc29a4547afc059b8138a12e42474fe3c Mon Sep 17 00:00:00 2001 From: Alex Taber Date: Mon, 14 Dec 2015 15:34:03 -0500 Subject: [PATCH] Added rust nanorc file --- rust.nanorc | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 rust.nanorc diff --git a/rust.nanorc b/rust.nanorc new file mode 100644 index 0000000..a8e2e90 --- /dev/null +++ b/rust.nanorc @@ -0,0 +1,36 @@ +# Nano configuration for Rust +# Copyright 2015 The Rust Project Developers. +# +# NOTE: Rules are applied in order: later rules re-colorize matching text. +syntax "rust" "\.rs" + +# function definition +color magenta "fn [a-z0-9_]+" + +# Reserved words +color yellow "\<(abstract|alignof|as|become|box|break|const|continue|crate|do|else|enum|extern|false|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|offsetof|override|priv|pub|pure|ref|return|sizeof|static|self|struct|super|true|trait|type|typeof|unsafe|unsized|use|virtual|where|while|yield)\>" + +# macros +color red "[a-z_]+!" + +# Constants +color magenta "[A-Z][A-Z_]+" + +# Traits/Enums/Structs/Types/etc. +color magenta "[A-Z][a-z]+" + +# Strings +color green "\".*\"" +color green start="\".*\\$" end=".*\"" +# NOTE: This isn't accurate but matching "#{0,} for the end of the string is too liberal +color green start="r#+\"" end="\"#+" + +# Comments +color blue "//.*" +color blue start="/\*" end="\*/" + +# Attributes +color magenta start="#!\[" end="\]" + +# Some common markers +color brightcyan "(XXX|TODO|FIXME|\?\?\?)"