From 7012b8b12c9a056bf8b111914134affc75d4fe9a Mon Sep 17 00:00:00 2001 From: Yadunandan Pillai Date: Wed, 3 Apr 2024 07:03:16 -0400 Subject: [PATCH] Added custom styling for preprocessor macros Styles such as bold and italic can be defined for preprocessor macros. Updated the default syntax group mapping, boilerplate config, and docs to reflect these changes. Note: make docgen was not working for me so I manually updated the documentation myself. Please advise if changes are needed. --- doc/nightfox.txt | 1 + lua/nightfox/config.lua | 1 + lua/nightfox/group/syntax.lua | 2 +- usage.md | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/nightfox.txt b/doc/nightfox.txt index 45935fba..91681ea2 100644 --- a/doc/nightfox.txt +++ b/doc/nightfox.txt @@ -266,6 +266,7 @@ options.styles {table} `styles` is a table that contains a list - keywords - numbers - operators +- preprocs - strings - types - variables diff --git a/lua/nightfox/config.lua b/lua/nightfox/config.lua index c4df57b3..cba4b03a 100644 --- a/lua/nightfox/config.lua +++ b/lua/nightfox/config.lua @@ -27,6 +27,7 @@ local defaults = { keywords = "NONE", numbers = "NONE", operators = "NONE", + preprocs = "NONE", strings = "NONE", types = "NONE", variables = "NONE", diff --git a/lua/nightfox/group/syntax.lua b/lua/nightfox/group/syntax.lua index 58114e2d..809c8f12 100644 --- a/lua/nightfox/group/syntax.lua +++ b/lua/nightfox/group/syntax.lua @@ -27,7 +27,7 @@ function M.get(spec, config) Keyword = { fg = syn.keyword, style = stl.keywords }, -- any other keyword Exception = { link = "Keyword" }, -- try, catch, throw - PreProc = { fg = syn.preproc }, -- (preferred) generic Preprocessor + PreProc = { fg = syn.preproc, style = stl.preprocs }, -- (preferred) generic Preprocessor Include = { link = "PreProc" }, -- preprocessor #include Define = { link = "PreProc" }, -- preprocessor #define Macro = { link = "PreProc" }, -- same as Define diff --git a/usage.md b/usage.md index 3b40bc93..0f1e484e 100644 --- a/usage.md +++ b/usage.md @@ -208,6 +208,7 @@ combination of |highlight-args|. The list of syntax components are: - keywords - numbers - operators +- preprocs - strings - types - variables