Skip to content

Commit

Permalink
feat: added custom styling for preprocessor macros
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
thesw4rm committed Apr 12, 2024
1 parent e352a32 commit ce0cdf8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions doc/nightfox.txt
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ options.styles {table} `styles` is a table that contains a list
- keywords
- numbers
- operators
- preprocs
- strings
- types
- variables
Expand Down
1 change: 1 addition & 0 deletions lua/nightfox/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ local defaults = {
keywords = "NONE",
numbers = "NONE",
operators = "NONE",
preprocs = "NONE",
strings = "NONE",
types = "NONE",
variables = "NONE",
Expand Down
2 changes: 1 addition & 1 deletion lua/nightfox/group/syntax.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ combination of |highlight-args|. The list of syntax components are:
- keywords
- numbers
- operators
- preprocs
- strings
- types
- variables
Expand Down

0 comments on commit ce0cdf8

Please sign in to comment.