From 4f1dd5c151fa9df359261a6ad6b3c1ba54414a19 Mon Sep 17 00:00:00 2001 From: leo60228 Date: Wed, 18 Nov 2020 17:43:17 -0500 Subject: [PATCH] Add fields to Nix highlighting --- queries/nix/highlights.scm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/queries/nix/highlights.scm b/queries/nix/highlights.scm index d10fe6a49..d399b6cd2 100644 --- a/queries/nix/highlights.scm +++ b/queries/nix/highlights.scm @@ -75,6 +75,10 @@ ; string interpolation (this was very annoying to get working properly) (interpolation "${" @punctuation.special (_) "}" @punctuation.special) @none +; fields (the `.` in `a.b = c;` isn't included) +(attrset (bind . (attrpath (identifier) @field))) +(rec_attrset (bind . (attrpath (identifier) @field))) + ; integers, also highlight a unary - [ (unary "-" (integer))