From 3f70708a33556d9d2747643a76bb6e83f8929156 Mon Sep 17 00:00:00 2001 From: Igor Gorohovsky Date: Mon, 20 Jan 2025 16:10:40 +0200 Subject: [PATCH] fix json highlighting --- README.md | 11 ++++++++++- examples/json.json | 30 ++++++++++++++++++++++++++++++ lua/pustota.lua | 3 +++ 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 examples/json.json diff --git a/README.md b/README.md index 4715f0a..5bb0b71 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,18 @@ A clean, minimalist Neovim colorscheme inspired by the original [pustota VSCode - Distraction-free, minimalist aesthetic - Consistent and calm color palette - Treesitter-powered syntax highlighting -- Great for Python, Rust, Elixir, Lua, Dockerfile, YAML, and more +- Great for Python, Rust, Elixir, Lua and more - Closely matches the original VSCode theme (behavior for untested languages may vary) +## Tested languages +- Python +- Rust +- Elixir +- Lua +- JSON +- Dockerfile +- YAML + ## Installation For the best experience, ensure you have Treesitter installed and highlighting enabled. Example with [lazy.nvim]: diff --git a/examples/json.json b/examples/json.json new file mode 100644 index 0000000..4d48f5f --- /dev/null +++ b/examples/json.json @@ -0,0 +1,30 @@ +{ + "title": "Neovim Theme Test", + "description": "A JSON file to test highlighting of different JSON constructs.", + "stringKey": "Hello, world!", + "escapeSequences": "Tabs\t, newlines\n, and quotes \"...\"", + "booleanTrue": true, + "booleanFalse": false, + "nullValue": null, + "integerNumber": 42, + "floatNumber": 3.14159, + "emptyArray": [], + "nonEmptyArray": [ + "One", + "Two", + "Three", + { + "nestedObjectInArray": true + } + ], + "objectKey": { + "nestedString": "inside object", + "nestedBoolean": false, + "nestedNumber": 999, + "nestedArray": [ + { + "deepObjectKey": "deepValue" + } + ] + } +} diff --git a/lua/pustota.lua b/lua/pustota.lua index 99b2bec..a56126f 100644 --- a/lua/pustota.lua +++ b/lua/pustota.lua @@ -117,6 +117,9 @@ M.hl_langs = function() hl(0, "@dot.elixir", { fg = colors.gray }) hl(0, "@constant.builtin.elixir", { link = "Constant" }) hl(0, "@string.special.elixir", { fg = colors.gray }) + + -- JSON specific + hl(0, "@property.json", { fg = colors.gray }) end local highlight = function()