From 40f85c4bc9cac624596f5555445f067e85e57335 Mon Sep 17 00:00:00 2001 From: Arctic Ice Studio Date: Sun, 14 Apr 2019 19:38:47 +0200 Subject: [PATCH] Added basic syntax highlighting support for Rust This commit adds basic syntax highlighting support for Rust (1): Traits (2) and enums (3) are colorized with `nord7` and with bold font to make them visually stand out more. Also attributes (4) and derives (5) are colored with `nord10`. Macros (6) are colorized with `nord8` and bold font to make them visually different from "normal" functions. Escape (7) sequences are colored with `nord13`. Import statements and paths are correctly colored with keyword and type colors. References: (1) https://www.rust-lang.org (2) https://doc.rust-lang.org/book/ch10-02-traits.html (3) https://doc.rust-lang.org/1.1.0/book/enums.html (4) https://doc.rust-lang.org/reference/attributes.html (5) https://doc.rust-lang.org/edition-guide/rust-2018/macros/custom-derive.html (6) https://doc.rust-lang.org/1.8.0/book/macros.html (7) https://doc.rust-lang.org/reference/tokens.html#ascii-escapes GH-138 --- colors/nord.vim | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/colors/nord.vim b/colors/nord.vim index 1bbfaf8e..2b58b5c9 100755 --- a/colors/nord.vim +++ b/colors/nord.vim @@ -451,6 +451,18 @@ hi! link rubyLocalVariableOrMethod Function hi! link rubyPseudoVariable Keyword hi! link rubyRegexp SpecialChar +call s:hi("rustAttribute", s:nord10_gui, "", s:nord10_term, "", "", "") +call s:hi("rustEnum", s:nord7_gui, "", s:nord7_term, "", "bold", "") +call s:hi("rustMacro", s:nord8_gui, "", s:nord8_term, "", "bold", "") +call s:hi("rustModPath", s:nord7_gui, "", s:nord7_term, "", "", "") +call s:hi("rustPanic", s:nord9_gui, "", s:nord9_term, "", "bold", "") +call s:hi("rustTrait", s:nord7_gui, "", s:nord7_term, "", s:italic, "") +hi! link rustCommentLineDoc Comment +hi! link rustDerive rustAttribute +hi! link rustEnumVariant rustEnum +hi! link rustEscape SpecialChar +hi! link rustQuestionMark Keyword + call s:hi("sassClass", s:nord7_gui, "", s:nord7_term, "", "", "") call s:hi("sassId", s:nord7_gui, "", s:nord7_term, "", s:underline, "") hi! link sassAmpersand Keyword