Last active
January 3, 2020 20:22
-
-
Save Lokathor/9b06f2c2460a8ac566b688aeb4ee3d69 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## An improved version of the "official" rust highlight file, Licensed GPL v3 | |
syntax "rust" "\.rs" | |
comment "//" | |
# The order of these colorations is significant. | |
# Matches later down will re-color earlier matches. | |
# Thus, we place the most general matches first and allow them to be overriden later if necessary. | |
# Function definitions | |
color magenta "fn [a-zA-Z_0-9]+" | |
# Constants/Traits/Enums/Structs/Types/... | |
color magenta "[A-Z][A-Za-z0-9_]+" | |
# Reserved words | |
color yellow "\<(abstract|alignof|as|async|await|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)\>" | |
color brightred "\<(unsafe)\>" | |
# Operators | |
color yellow "&" | |
color white "&=" | |
# Macros | |
color red "[a-zA-Z_]+!" | |
# Strings and Byte Strings | |
color green "b?\".*\"" | |
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="\"#+" | |
# Characters and Bytes | |
color green "b?'\\?.'" | |
# Comments | |
color cyan "//.*" | |
color cyan start="/\*" end="\*/" | |
# Attributes | |
color brightmagenta start="#!?\[" end="\]" | |
# Some common markers | |
color brightcyan "(XXX|TODO|FIXME|\?\?\?)" | |
## Just general settings | |
set autoindent | |
set tabsize 2 | |
set tabstospaces | |
set softwrap | |
set smarthome | |
set smooth |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment