diff options
| author | Barosl LEE <github@barosl.com> | 2015-01-21 02:16:47 +0900 |
|---|---|---|
| committer | Barosl LEE <github@barosl.com> | 2015-01-21 02:16:47 +0900 |
| commit | 356c61da8d8059a13e81ad07bb984cd49873e228 (patch) | |
| tree | 91db6e41c3fd0d92a5992a1e3323161cdb127664 | |
| parent | 29ece80d34f5be54a628adea4b3f91193a6865dc (diff) | |
| parent | ac4baca72a392bf683d513e5cd3aa00b01f5e7a8 (diff) | |
| download | rust-356c61da8d8059a13e81ad07bb984cd49873e228.tar.gz rust-356c61da8d8059a13e81ad07bb984cd49873e228.zip | |
Rollup merge of #21326 - look:nano-syntax-highlighting, r=kmcallister
rust.nanorc provides syntax highlighting for Rust. An attempt has been made to make the syntax highlighting look good on both dark and light terminals. Issue #21286. This PR is dedicated to @substars and nano-lovers everywhere.
| -rw-r--r-- | src/etc/nano/rust.nanorc | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/etc/nano/rust.nanorc b/src/etc/nano/rust.nanorc new file mode 100644 index 00000000000..1217769096d --- /dev/null +++ b/src/etc/nano/rust.nanorc @@ -0,0 +1,35 @@ +# 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|be|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 "//.*" + +# Attributes +color magenta start="#!\[" end="\]" + +# Some common markers +color brightcyan "(XXX|TODO|FIXME|\?\?\?)" |
