nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

rust.nanorc (1078B)


      1 ## Syntax highlighting for Rust.
      2 
      3 ## Copyright 2015 Luke Francl.
      4 ## Licensed under GPL version 3 or newer.
      5 
      6 syntax rust "\.(rlib|rs)$"
      7 comment "//"
      8 
      9 # Function definitions
     10 color magenta "fn [[:lower:][:digit:]_]+"
     11 
     12 # Reserved words
     13 color yellow "\<(abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|false|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|true|try|type|typeof|unsafe|unsized|use|virtual|where|while|yield)\>"
     14 
     15 # Macros
     16 color red "[[:lower:]_]+!"
     17 
     18 # Constants
     19 color magenta "[[:upper:]][[:upper:][:digit:]_]+"
     20 
     21 # Traits/Enums/Structs/Types/...
     22 color magenta "[[:upper:]][[:alnum:]]+"
     23 
     24 # Strings
     25 color green ""([^"]|\\")*""
     26 color green start=""([^"]|\\")*\\$" end="(^|.*[^\])""
     27 ## Inaccurate, but it's not possible to balance the number of hashes.
     28 color green start="r#+"" end=""#+"
     29 
     30 # Comments
     31 color blue "//.*"
     32 color blue start="/\*" end="\*/"
     33 
     34 # Attributes
     35 color magenta start="#!\[" end="\]"
     36 
     37 # Some common markers
     38 color brightcyan "XXX|TODO|FIXME|\?\?\?"