Skip to content

Commit

Permalink
Fixes, consistent and descriptive naming
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexvZyl committed Jan 27, 2023
1 parent cb4bb15 commit 4bc474d
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 47 deletions.
6 changes: 3 additions & 3 deletions lua/nordic/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ local defaults = {
style = 'flat',
},
-- Enable bold keywords and operators
bold = true,
bold_keywords = true,
-- Enable italicized comments
italic = true,
italic_comments = true,
-- Enable general editor background transparency
transparent = false,
transparent_bg = false,
-- Override styling of any highlight group
override = {},
}
Expand Down
6 changes: 3 additions & 3 deletions lua/nordic/groups/init.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local merge = require('nordic.utils').merge
local m = require('nordic.utils').merge

local M = {}

Expand Down Expand Up @@ -30,10 +30,10 @@ M.core = {
function M.get_groups()
local groups = {}
for _, integration in ipairs(M.integrations) do
groups = merge(groups, require('nordic.groups.integrations.' .. integration))
groups = m(groups, require('nordic.groups.integrations.' .. integration))
end
for _, core in ipairs(M.core) do
groups = merge(groups, require('nordic.groups.native.' .. core))
groups = m(groups, require('nordic.groups.native.' .. core))
end
return groups
end
Expand Down
8 changes: 4 additions & 4 deletions lua/nordic/groups/integrations/gitsigns.lua
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
local c = require 'nordic.colors'
local opts = require('nordic.config').options
local o = require('nordic.config').options

return {

GitSignsAdd = {
fg = c.git.add,
bg = opts.transparent and c.none or c.bg_sidebar,
bg = o.transparent_bg and c.none or c.bg_sidebar,
},

GitSignsChange = {
fg = c.git.change,
bg = opts.transparent and c.none or c.bg_sidebar,
bg = o.transparent_bg and c.none or c.bg_sidebar,
},

GitSignsDelete = {
fg = c.git.delete,
bg = opts.transparent and c.none or c.bg_sidebar,
bg = o.transparent_bg and c.none or c.bg_sidebar,
},

GitSignsAddPreview = {
Expand Down
8 changes: 4 additions & 4 deletions lua/nordic/groups/integrations/nvim-tree.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local c = require 'nordic.colors'
local opts = require('nordic.config').options
local o = require('nordic.config').options

return {

Expand All @@ -9,11 +9,11 @@ return {
NvimTreeOpenedFolderName = { fg = c.blue2 },
NvimTreeOpenedName = { fg = c.blue1 },
NvimTreeRootFolder = { fg = c.yellow.base, bold = true },
NvimTreeNormal = { fg = c.white0, bg = opts.transparent and c.none or c.black },
NvimTreeNormalNC = { fg = c.white0, bg = opts.transparent and c.none or c.black },
NvimTreeNormal = { fg = c.white0, bg = o.transparent_bg and c.none or c.black },
NvimTreeNormalNC = { fg = c.white0, bg = o.transparent_bg and c.none or c.black },
NvimTreeIndentMarker = { fg = c.gray2 },

NvimTreeWinSeparator = { fg = c.bg_sidebar, bg = opts.transparent and c.none or c.bg_sidebar },
NvimTreeWinSeparator = { fg = c.bg_sidebar, bg = o.transparent_bg and c.none or c.bg_sidebar },
NvimTreeGitDirty = { fg = c.git.change },
NvimTreeGitNew = { fg = c.git.add },
NvimTreeGitDeleted = { fg = c.git.delete },
Expand Down
4 changes: 2 additions & 2 deletions lua/nordic/groups/integrations/telescope.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local c = require 'nordic.colors'
local opts = require('nordic.config').options
local o = require('nordic.config').options

-- Classic.
local groups = {
Expand Down Expand Up @@ -79,7 +79,7 @@ local groups = {
}

-- Apply the flat style.
if opts.telescope.style == 'flat' then
if o.telescope.style == 'flat' then
-- Normals.
groups.TelescopePromptNormal = {
bg = c.gray1,
Expand Down
22 changes: 11 additions & 11 deletions lua/nordic/groups/integrations/treesitter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,17 @@ return {
['@constant.macro'] = { fg = c.magenta.bright },
['@constant.builtin'] = { fg = c.magenta.bright },
-- Oranges (Keywords).
['@keyword'] = { fg = c.orange.base, bold = o.bold },
['@keyword.return'] = { fg = c.orange.base, bold = o.bold },
['@keyword.function'] = { fg = c.orange.base, bold = o.bold },
['@keyword.export'] = { fg = c.orange.base, bold = o.bold },
['@keyword.operator'] = { fg = c.orange.bright, bold = o.bold },
['@repeat'] = { fg = c.orange.base, bold = o.bold },
['@conditional'] = { fg = c.orange.base, bold = o.bold },
['@operator'] = { fg = c.orange.bright, bold = o.bold },
['@class'] = { fg = c.orange.base, bold = o.bold },
['@type.qualifier'] = { fg = c.orange.base, bold = o.bold },
['@storageclass'] = { fg = c.orange.base, bold = o.bold },
['@keyword'] = { fg = c.orange.base, bold = o.bold_keywords },
['@keyword.return'] = { fg = c.orange.base, bold = o.bold_keywords },
['@keyword.function'] = { fg = c.orange.base, bold = o.bold_keywords },
['@keyword.export'] = { fg = c.orange.base, bold = o.bold_keywords },
['@keyword.operator'] = { fg = c.orange.bright, bold = o.bold_keywords },
['@repeat'] = { fg = c.orange.base, bold = o.bold_keywords },
['@conditional'] = { fg = c.orange.base, bold = o.bold_keywords },
['@operator'] = { fg = c.orange.bright, bold = o.bold_keywords },
['@class'] = { fg = c.orange.base, bold = o.bold_keywords },
['@type.qualifier'] = { fg = c.orange.base, bold = o.bold_keywords },
['@storageclass'] = { fg = c.orange.base, bold = o.bold_keywords },
-- Reds.
['@preproc'] = { fg = c.red.base, bold = true },
['@attribute'] = { fg = c.red.base, bold = true },
Expand Down
12 changes: 6 additions & 6 deletions lua/nordic/groups/native/editor.lua
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
-- Notes and format from @folke/tokyonight.nvim.

local c = require 'nordic.colors'
local opts = require('nordic.config').options
local o = require('nordic.config').options

return {

Comment = {
fg = c.comment,
italic = true,
italic = o.italic_comments,
}, -- any comment

ColorColumn = {
Expand Down Expand Up @@ -78,7 +78,7 @@ return {
}, -- 'foldcolumn'

SignColumn = {
bg = opts.transparent and c.none or c.bg,
bg = o.transparent_bg and c.none or c.bg,
fg = c.fg_gutter,
}, -- column where |signs| are displayed

Expand Down Expand Up @@ -127,17 +127,17 @@ return {

Normal = {
fg = c.fg,
bg = opts.transparent and c.none or c.bg,
bg = o.transparent_bg and c.none or c.bg,
}, -- normal text

NormalNC = {
fg = c.fg,
bg = opts.transparent and c.none or c.bg,
bg = o.transparent_bg and c.none or c.bg,
}, -- normal text in non-current windows

NormalSB = {
fg = c.fg_sidebar,
bg = opts.transparent and c.none or c.bg_sidebar,
bg = o.transparent_bg and c.none or c.bg_sidebar,
}, -- normal text in sidebar

NormalFloat = {
Expand Down
28 changes: 14 additions & 14 deletions lua/nordic/groups/native/syntax.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- Notes and format from @folke/tokyonight.nvim.

local c = require 'nordic.colors'
local opts = require('nordic.config').options
local o = require('nordic.config').options

return {

Expand All @@ -21,15 +21,15 @@ return {
Identifier = { fg = c.fg }, -- (preferred) any variable name
Function = { fg = c.blue2 }, -- function name (also: methods for classes)

Statement = { fg = c.orange.base, bold = opts.bold }, -- (preferred) any statement
Conditional = { fg = c.orange.base, bold = opts.bold }, -- if, then, else, endif, switch, etc.
Repeat = { fg = c.orange.base, bold = opts.bold }, -- for, do, while, etc.
Label = { fg = c.orange.base, bold = opts.bold }, -- case, default, etc.
Operator = { fg = c.orange.bright, bold = opts.bold }, -- "sizeof", "+", "*", etc.
Keyword = { fg = c.orange.base, bold = opts.bold }, -- any other keyword
Exception = { fg = c.red.base, bold = opts.bold }, -- try, catch, throw
Statement = { fg = c.orange.base, bold = o.bold_keywords }, -- (preferred) any statement
Conditional = { fg = c.orange.base, bold = o.bold_keywords }, -- if, then, else, endif, switch, etc.
Repeat = { fg = c.orange.base, bold = o.bold_keywords }, -- for, do, while, etc.
Label = { fg = c.orange.base, bold = o.bold_keywords }, -- case, default, etc.
Operator = { fg = c.orange.bright, bold = o.bold_keywords }, -- "sizeof", "+", "*", etc.
Keyword = { fg = c.orange.base, bold = o.bold_keywords }, -- any other keyword
Exception = { fg = c.red.base, bold = o.bold_keywords }, -- try, catch, throw

Comment = { fg = c.comment, italic = opts.italic },
Comment = { fg = c.comment, italic = o.italic_comments },

PreProc = { fg = c.red.base, bold = true }, -- (preferred) generic Preprocessor
Include = { fg = c.red.base, bold = true }, -- preprocessor #include
Expand All @@ -42,7 +42,7 @@ return {
Structure = { fg = c.orange.base }, -- struct, union, enum, etc.
Typedef = { fg = c.yellow.base }, -- A typedef

-- What are these? TODopts.
-- What are these? TODO.
Special = { fg = c.blue1 }, -- (preferred) any special symbol
-- SpecialChar = { }, -- special character in a constant
-- Tag = { }, -- you can use CTRL-] on this
Expand All @@ -60,11 +60,11 @@ return {
Error = { fg = c.error }, -- (preferred) any erroneous construct
Todo = { bg = c.yellow.dim, fg = c.bg_dark }, -- (preferred) anything that needs extra attention; mostly the keywords TODO FIXME and XXX

-- What are these? TODopts.
-- What are these? TODO.
qfLineNr = { fg = c.gray4 },
qfFileName = { fg = c.blue1 },

-- What are these? TODopts.
-- What are these? TODO.
htmlH1 = { fg = c.magenta.base, bold = true },
htmlH2 = { fg = c.blue1, bold = true },

Expand All @@ -83,8 +83,8 @@ return {
markdownLinkText = { fg = c.blue1, underline = true },

['@punctuation.special.markdown'] = { fg = c.orange.base, bold = true },
['@text.todopts.unchecked'] = { fg = c.blue1 }, -- For brackets and parens.
['@text.todopts.checked'] = { fg = c.green.base }, -- For brackets and parens.
['@text.todo.unchecked'] = { fg = c.blue1 }, -- For brackets and parens.
['@text.todo.checked'] = { fg = c.green.base }, -- For brackets and parens.
['@text.literal.markdown_inline'] = { bg = c.black, fg = c.blue1 },
['@text.literal.markdown'] = { link = 'Normal' },
['helpCommand'] = { bg = c.black, fg = c.blue1 },
Expand Down

2 comments on commit 4bc474d

@lcrownover
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch on a couple of those later "todo" bugs. Sorry!

@AlexvZyl
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha, no problem!

Please sign in to comment.