From c38e0bac50c36bec5ae86b29c58a84722e750db9 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Tue, 27 Jan 2026 18:24:57 -0500 Subject: [PATCH 01/26] fix: name black and white to less confusing fg & bg --- lua/midnight/palette.lua | 12 ++++----- lua/midnight/theme.lua | 56 ++++++++++++++++++++-------------------- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/lua/midnight/palette.lua b/lua/midnight/palette.lua index 273f371..2b0ed0b 100644 --- a/lua/midnight/palette.lua +++ b/lua/midnight/palette.lua @@ -1,7 +1,7 @@ local M = {} ---@class Palette ----@field black string +---@field foreground string ---@field red string ---@field green string ---@field yellow string @@ -9,7 +9,7 @@ local M = {} ---@field magenta string ---@field cyan string ---@field orange? string ----@field white string +---@field background string ---@field bright_black string ---@field bright_red string ---@field bright_green string @@ -34,7 +34,7 @@ local M = {} ---@type Palette M.midnight = { - black = '#121212', + foreground = '#121212', red = '#ff6b6b', green = '#98c379', yellow = '#e5c07b', @@ -42,7 +42,7 @@ M.midnight = { magenta = '#c678dd', cyan = '#56b6c2', orange = '#e5a56b', - white = '#e0e0e0', + background = '#e0e0e0', bright_black = '#666666', bright_red = '#f48771', @@ -63,7 +63,7 @@ M.midnight = { ---@type Palette M.daylight = { - black = '#f5f5f5', + foreground = '#f5f5f5', red = '#c7254e', green = '#2d7f3e', yellow = '#996800', @@ -71,7 +71,7 @@ M.daylight = { magenta = '#ae3ec9', cyan = '#1098ad', orange = '#d9730d', - white = '#1a1a1a', + background = '#1a1a1a', bright_black = '#999999', bright_red = '#e03e52', diff --git a/lua/midnight/theme.lua b/lua/midnight/theme.lua index a3c6499..a8d8844 100644 --- a/lua/midnight/theme.lua +++ b/lua/midnight/theme.lua @@ -59,7 +59,7 @@ function M.apply() hi( 'Normal', - { fg = cs.white, bg = cs.black }, + { fg = cs.background, bg = cs.foreground }, { 'Identifier', 'Special', 'StatusLine', 'StatusLineNC', 'Winbar', 'WinbarNC' } ) hi('NonText', { fg = cs.grey }, { 'SpecialKey' }) @@ -68,13 +68,13 @@ function M.apply() hi('CursorLine', { bg = cs.dark_grey }, { 'ColorColumn', 'Folded', 'Visual' }) hi('CursorLineNr', { fg = cs.medium_emphasis }) - hi('Conceal', { fg = cs.light_black, bg = cs.black }) + hi('Conceal', { fg = cs.light_black, bg = cs.foreground }) hi('Directory', { fg = cs.blue }) hi('Error', { fg = cs.red }) hi('ErrorMsg', { bold = true, underline = true, fg = cs.red }) hi('MoreMsg', { fg = cs.yellow }, { 'WarningMsg' }) hi('MatchParen', { bg = cs.med_grey }) - hi('NormalFloat', { bg = cs.black }, { + hi('NormalFloat', { bg = cs.foreground }, { 'LspInfoBorder', 'FloatBorder', 'FloatShadow', @@ -87,32 +87,32 @@ function M.apply() tshi('Comment', { fg = cs.light_black }) tshi('Constant', { fg = cs.green }) tshi('Define', { fg = cs.blue }) - tshi('Function', { fg = cs.white }, { '@function.builtin', '@function.macro' }) + tshi('Function', { fg = cs.background }, { '@function.builtin', '@function.macro' }) tshi('Include', { fg = cs.blue }) tshi('Keyword', { fg = cs.blue }, { 'Statement' }) - tshi('Namespace', { fg = cs.white }) + tshi('Namespace', { fg = cs.background }) tshi('Number', { fg = cs.green }) - tshi('Operator', { fg = cs.white }, { '@keyword.operator', '@conditional.ternary' }) + tshi('Operator', { fg = cs.background }, { '@keyword.operator', '@conditional.ternary' }) hi('Delimiter', { none = true }) - hi('@punctuation.delimiter', { fg = cs.white }) + hi('@punctuation.delimiter', { fg = cs.background }) tshi('PreProc', { fg = cs.blue }) tshi('String', { fg = cs.green }, { '@character' }) hi('@string.escape', { fg = cs.green }) - tshi('Title', { bold = true, fg = cs.white }) + tshi('Title', { bold = true, fg = cs.background }) - hi('@tag', { fg = cs.white }) - hi('@tag.attribute', { fg = cs.white }) - hi('@tag.delimiter', { fg = cs.white }) + hi('@tag', { fg = cs.background }) + hi('@tag.attribute', { fg = cs.background }) + hi('@tag.delimiter', { fg = cs.background }) - tshi('Type', { fg = cs.white }) - hi('@type.qualifier', { fg = cs.white }, { '@storageclass' }) - hi('@lsp.type.enum', { fg = cs.white }, { '@lsp.type.class' }) + tshi('Type', { fg = cs.background }) + hi('@type.qualifier', { fg = cs.background }, { '@storageclass' }) + hi('@lsp.type.enum', { fg = cs.background }, { '@lsp.type.class' }) hi('@lsp.type.comment', { none = true }, { '@lsp.type.macro' }) hi('@text.emphasis', { italic = true }) hi('@text.strong', { bold = true }) hi('@text.underline', { underline = true }) - hi('@text.uri', { fg = cs.white, underline = true }, { '@text.reference' }) + hi('@text.uri', { fg = cs.background, underline = true }, { '@text.reference' }) hi('@comment.danger', { fg = cs.red, bold = true, italic = true }) hi('@comment.note', { fg = cs.blue, bold = true, italic = true }) @@ -139,18 +139,18 @@ function M.apply() hi('DiagnosticUnderlineInfo', { undercurl = true, special = cs.light_black }) hi('SpellBad', { underline = true, special = cs.red }) - hi('SpellRare', { underline = true, special = cs.white }) - hi('SpellCap', { underline = true, special = cs.white }) - hi('SpellLocal', { underline = true, special = cs.white }) + hi('SpellRare', { underline = true, special = cs.background }) + hi('SpellCap', { underline = true, special = cs.background }) + hi('SpellLocal', { underline = true, special = cs.background }) - hi('gitCommitSummary', { fg = cs.white }) + hi('gitCommitSummary', { fg = cs.background }) - hi('@attribute.diff', { fg = cs.white }) + hi('@attribute.diff', { fg = cs.background }) hi('DiffAdd', { fg = cs.green }, { '@text.diff.add', 'diffAdded' }) hi('DiffDelete', { fg = cs.red }, { '@text.diff.delete', 'diffRemoved' }) hi('DiffChange', { fg = cs.yellow }) - hi('@constructor.lua', { fg = cs.white }) + hi('@constructor.lua', { fg = cs.background }) hi('@markup.heading.gitcommit', { none = true }) hi('GitSignsCurrentLineBlame', { italic = true, fg = cs.light_black }) @@ -162,9 +162,9 @@ function M.apply() link('Pmenu', 'CmpPmenu') link('PmenuSel', 'CmpPmenuSel') - hi('CmpItemAbbr', { fg = cs.white }) - hi('CmpItemAbbrMatch', { fg = cs.white, bold = true }) - hi('CmpItemAbbrMatchFuzzy', { fg = cs.white, bold = true }) + hi('CmpItemAbbr', { fg = cs.background }) + hi('CmpItemAbbrMatch', { fg = cs.background, bold = true }) + hi('CmpItemAbbrMatchFuzzy', { fg = cs.background, bold = true }) hi('CmpItemAbbrDeprecated', { fg = cs.light_black, strikethrough = true }) hi('CmpItemMenu', { fg = cs.light_black }) @@ -215,18 +215,18 @@ function M.apply() link('Directory', 'OilDir') link('NormalFloat', 'FzfLuaBorder') - hi('FzfLuaHeaderText', { fg = cs.white }, { 'FzfLuaBufFlagCur' }) - hi('FzfLuaBufFlagAlt', { fg = cs.white }) + hi('FzfLuaHeaderText', { fg = cs.background }, { 'FzfLuaBufFlagCur' }) + hi('FzfLuaBufFlagAlt', { fg = cs.background }) link('Normal', 'FzfLuaLivePrompt') - vim.g.terminal_color_0 = cs.black + vim.g.terminal_color_0 = cs.foreground vim.g.terminal_color_1 = cs.red vim.g.terminal_color_2 = cs.green vim.g.terminal_color_3 = cs.yellow vim.g.terminal_color_4 = cs.blue vim.g.terminal_color_5 = cs.magenta vim.g.terminal_color_6 = cs.cyan - vim.g.terminal_color_7 = cs.white + vim.g.terminal_color_7 = cs.background vim.g.terminal_color_8 = cs.bright_black vim.g.terminal_color_9 = cs.bright_red vim.g.terminal_color_10 = cs.bright_green From f522ac7371b18c9c9f3d25adbfde437118c35282 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Tue, 27 Jan 2026 18:25:58 -0500 Subject: [PATCH 02/26] fix: typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ea19f09..85735e9 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Install with any package manager of your choice. For example, with ## Motivation I find existing colorschemes to generally be excessively colorful and -distracting, rather than informative. I wrote midnight.nvim to focus on code +distracting rather than informative. I wrote midnight.nvim to focus on code structure, specifically for competitive programming and workplace software development environments. I included highlighting of constants (e.g. strings, numbers, booleans) and language keywords to emphasize the maximally important From 95f377b8dfe7b6ee1716d5857bb5bb61ccaabd30 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Tue, 27 Jan 2026 18:27:09 -0500 Subject: [PATCH 03/26] feat: use accent color in diff text --- lua/midnight/theme.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/midnight/theme.lua b/lua/midnight/theme.lua index a8d8844..75615ad 100644 --- a/lua/midnight/theme.lua +++ b/lua/midnight/theme.lua @@ -149,6 +149,7 @@ function M.apply() hi('DiffAdd', { fg = cs.green }, { '@text.diff.add', 'diffAdded' }) hi('DiffDelete', { fg = cs.red }, { '@text.diff.delete', 'diffRemoved' }) hi('DiffChange', { fg = cs.yellow }) + hi('DiffText', { fg = cs.foreground, bg = cs.blue }) hi('@constructor.lua', { fg = cs.background }) hi('@markup.heading.gitcommit', { none = true }) From 593ae1bc2116f39da1f06a7eb2eec6cc97eb76cd Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Sun, 1 Feb 2026 17:12:20 -0500 Subject: [PATCH 04/26] fix: username updated --- README.md | 2 +- doc/midnight.nvim.txt | 2 +- midnight.nvim-scm-1.rockspec | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 85735e9..6c4fd1b 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Install with any package manager of your choice. For example, with ```lua { - 'barrett-ruth/midnight.nvim', + 'barrettruth/midnight.nvim', config = function() vim.cmd.colorscheme('midnight') end, diff --git a/doc/midnight.nvim.txt b/doc/midnight.nvim.txt index 459f571..9ec58e7 100644 --- a/doc/midnight.nvim.txt +++ b/doc/midnight.nvim.txt @@ -16,7 +16,7 @@ INSTALLATION *midnight-installation* >lua { - 'barrett-ruth/midnight.nvim', + 'barrettruth/midnight.nvim', config = function() vim.cmd.colorscheme('midnight') end, diff --git a/midnight.nvim-scm-1.rockspec b/midnight.nvim-scm-1.rockspec index 95763a9..5f8d9a5 100644 --- a/midnight.nvim-scm-1.rockspec +++ b/midnight.nvim-scm-1.rockspec @@ -2,5 +2,5 @@ rockspec_format = '3.0' package = 'midnight.nvim' version = 'scm-1' -source = { url = 'git://github.com/barrett-ruth/midnight.nvim' } +source = { url = 'git://github.com/barrettruth/midnight.nvim' } build = { type = 'builtin' } From 4e72648c2dd164c798e014a21405076580908b87 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Mon, 2 Feb 2026 00:42:11 -0500 Subject: [PATCH 05/26] fix: Diff* ought to hl bg --- lua/midnight/theme.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/midnight/theme.lua b/lua/midnight/theme.lua index 75615ad..fc4fe4f 100644 --- a/lua/midnight/theme.lua +++ b/lua/midnight/theme.lua @@ -146,9 +146,9 @@ function M.apply() hi('gitCommitSummary', { fg = cs.background }) hi('@attribute.diff', { fg = cs.background }) - hi('DiffAdd', { fg = cs.green }, { '@text.diff.add', 'diffAdded' }) - hi('DiffDelete', { fg = cs.red }, { '@text.diff.delete', 'diffRemoved' }) - hi('DiffChange', { fg = cs.yellow }) + hi('DiffAdd', { bg = cs.green }, { '@text.diff.add', 'diffAdded' }) + hi('DiffDelete', { bg = cs.red }, { '@text.diff.delete', 'diffRemoved' }) + hi('DiffChange', { bg = cs.yellow }) hi('DiffText', { fg = cs.foreground, bg = cs.blue }) hi('@constructor.lua', { fg = cs.background }) From 733e04f48bf869d27d6c309fc7e4056ec732b722 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Mon, 2 Feb 2026 15:31:46 -0500 Subject: [PATCH 06/26] feat(color): diff change --- lua/midnight/palette.lua | 35 +++++++++++++++++++++++++++++++++++ lua/midnight/theme.lua | 6 +++--- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/lua/midnight/palette.lua b/lua/midnight/palette.lua index 2b0ed0b..a701c6a 100644 --- a/lua/midnight/palette.lua +++ b/lua/midnight/palette.lua @@ -1,5 +1,22 @@ local M = {} +---@param hex string +---@param bg_hex string +---@param alpha number +---@return string +function M.blend(hex, bg_hex, alpha) + local function parse(h) + h = h:gsub('#', '') + return tonumber(h:sub(1, 2), 16), tonumber(h:sub(3, 4), 16), tonumber(h:sub(5, 6), 16) + end + local r, g, b = parse(hex) + local bg_r, bg_g, bg_b = parse(bg_hex) + local blend_r = math.floor(r * alpha + bg_r * (1 - alpha)) + local blend_g = math.floor(g * alpha + bg_g * (1 - alpha)) + local blend_b = math.floor(b * alpha + bg_b * (1 - alpha)) + return string.format('#%02x%02x%02x', blend_r, blend_g, blend_b) +end + ---@class Palette ---@field foreground string ---@field red string @@ -31,6 +48,9 @@ local M = {} ---@field light_cyan? string ---@field light_white? string ---@field medium_emphasis? string +---@field diff_add? string +---@field diff_delete? string +---@field diff_change? string ---@type Palette M.midnight = { @@ -59,6 +79,15 @@ M.midnight = { dark_grey = '#222222', medium_emphasis = '#999999', + + -- Diff backgrounds: base color blended at 40% with visual bg (#121212) + -- Generated via: M.blend(base_color, '#121212', 0.4) + -- diff_add = M.blend('#98c379', '#121212', 0.4) -- green + -- diff_delete = M.blend('#ff6b6b', '#121212', 0.4) -- red + -- diff_change = M.blend('#e5c07b', '#121212', 0.4) -- yellow + diff_add = '#0c2f1e', + diff_delete = '#291f27', + diff_change = '#66583c', } ---@type Palette @@ -88,6 +117,12 @@ M.daylight = { dark_grey = '#ebebeb', medium_emphasis = '#666666', + + -- Diff backgrounds: base color blended at 40% with visual bg (#f5f5f5) + -- Generated via: M.blend(base_color, '#f5f5f5', 0.4) + diff_add = '#a5c5ab', + diff_delete = '#e2a1b2', + diff_change = '#d0bc93', } ---@return Palette diff --git a/lua/midnight/theme.lua b/lua/midnight/theme.lua index fc4fe4f..3a76ebf 100644 --- a/lua/midnight/theme.lua +++ b/lua/midnight/theme.lua @@ -146,9 +146,9 @@ function M.apply() hi('gitCommitSummary', { fg = cs.background }) hi('@attribute.diff', { fg = cs.background }) - hi('DiffAdd', { bg = cs.green }, { '@text.diff.add', 'diffAdded' }) - hi('DiffDelete', { bg = cs.red }, { '@text.diff.delete', 'diffRemoved' }) - hi('DiffChange', { bg = cs.yellow }) + hi('DiffAdd', { bg = cs.diff_add, fg = cs.green }, { '@text.diff.add', 'diffAdded' }) + hi('DiffDelete', { bg = cs.diff_delete, fg = cs.red }, { '@text.diff.delete', 'diffRemoved' }) + hi('DiffChange', { bg = cs.diff_change, fg = cs.yellow }) hi('DiffText', { fg = cs.foreground, bg = cs.blue }) hi('@constructor.lua', { fg = cs.background }) From 2b32dda9f9b7ea9a2f87ca0a4d6ee5fab06fc491 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Tue, 3 Feb 2026 01:18:32 -0500 Subject: [PATCH 07/26] misc cleanups for diffing --- lua/midnight/palette.lua | 6 +++--- lua/midnight/theme.lua | 9 +++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lua/midnight/palette.lua b/lua/midnight/palette.lua index a701c6a..c531133 100644 --- a/lua/midnight/palette.lua +++ b/lua/midnight/palette.lua @@ -84,10 +84,10 @@ M.midnight = { -- Generated via: M.blend(base_color, '#121212', 0.4) -- diff_add = M.blend('#98c379', '#121212', 0.4) -- green -- diff_delete = M.blend('#ff6b6b', '#121212', 0.4) -- red - -- diff_change = M.blend('#e5c07b', '#121212', 0.4) -- yellow + -- diff_change = M.blend('#7aa2f7', '#121212', 0.4) -- blue diff_add = '#0c2f1e', diff_delete = '#291f27', - diff_change = '#66583c', + diff_change = '#3a4a6d', } ---@type Palette @@ -122,7 +122,7 @@ M.daylight = { -- Generated via: M.blend(base_color, '#f5f5f5', 0.4) diff_add = '#a5c5ab', diff_delete = '#e2a1b2', - diff_change = '#d0bc93', + diff_change = '#a9b7e5', } ---@return Palette diff --git a/lua/midnight/theme.lua b/lua/midnight/theme.lua index 3a76ebf..1239f47 100644 --- a/lua/midnight/theme.lua +++ b/lua/midnight/theme.lua @@ -148,8 +148,13 @@ function M.apply() hi('@attribute.diff', { fg = cs.background }) hi('DiffAdd', { bg = cs.diff_add, fg = cs.green }, { '@text.diff.add', 'diffAdded' }) hi('DiffDelete', { bg = cs.diff_delete, fg = cs.red }, { '@text.diff.delete', 'diffRemoved' }) - hi('DiffChange', { bg = cs.diff_change, fg = cs.yellow }) - hi('DiffText', { fg = cs.foreground, bg = cs.blue }) + hi('DiffChange', { bg = cs.diff_change, fg = cs.blue }) + hi('DiffText', { bg = cs.blue, fg = cs.foreground }) + + hi('DiffsDiffAdd', { bg = cs.diff_add }) + hi('DiffsDiffDelete', { bg = cs.diff_delete }) + hi('DiffsDiffChange', { bg = cs.diff_change }) + hi('DiffsDiffText', { bg = cs.blue }) hi('@constructor.lua', { fg = cs.background }) hi('@markup.heading.gitcommit', { none = true }) From b54045f31a78a639962fd4e172b4e25953030728 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Tue, 3 Feb 2026 01:23:32 -0500 Subject: [PATCH 08/26] fix: explicitly remove underline from cursor --- lua/midnight/theme.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/midnight/theme.lua b/lua/midnight/theme.lua index 1239f47..25a7a15 100644 --- a/lua/midnight/theme.lua +++ b/lua/midnight/theme.lua @@ -65,7 +65,7 @@ function M.apply() hi('NonText', { fg = cs.grey }, { 'SpecialKey' }) hi('LineNr', { fg = cs.light_black }, { 'SignColumn' }) - hi('CursorLine', { bg = cs.dark_grey }, { 'ColorColumn', 'Folded', 'Visual' }) + hi('CursorLine', { bg = cs.dark_grey, underline = false }, { 'ColorColumn', 'Folded', 'Visual' }) hi('CursorLineNr', { fg = cs.medium_emphasis }) hi('Conceal', { fg = cs.light_black, bg = cs.foreground }) From 8b695453a8d6ba4816a2fda9968e95e9b19125af Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Tue, 3 Feb 2026 20:07:56 -0500 Subject: [PATCH 09/26] remove superfluous background setting --- colors/daylight.lua | 1 - colors/midnight.lua | 1 - 2 files changed, 2 deletions(-) diff --git a/colors/daylight.lua b/colors/daylight.lua index daa37f0..605553d 100644 --- a/colors/daylight.lua +++ b/colors/daylight.lua @@ -1,2 +1 @@ -vim.o.background = 'light' require('midnight').load() diff --git a/colors/midnight.lua b/colors/midnight.lua index dfd2424..605553d 100644 --- a/colors/midnight.lua +++ b/colors/midnight.lua @@ -1,2 +1 @@ -vim.o.background = 'dark' require('midnight').load() From 270ba26bce32c6fc561043feaf319a4f179149fd Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Tue, 3 Feb 2026 20:12:17 -0500 Subject: [PATCH 10/26] refactor: remove unused setup function Colorschemes load via :colorscheme command, making the setup() no-op redundant. --- lua/midnight/init.lua | 9 --------- 1 file changed, 9 deletions(-) diff --git a/lua/midnight/init.lua b/lua/midnight/init.lua index 7d03715..50a83ba 100644 --- a/lua/midnight/init.lua +++ b/lua/midnight/init.lua @@ -1,14 +1,5 @@ local M = {} ----@class MidnightConfig ----@field [string] any - ----@param opts? MidnightConfig ----@return nil -function M.setup(opts) - opts = opts or {} -end - ---@return nil function M.load() if vim.g.colors_name then From 32c1f23f90cd501be751b9ed6fd3c99b9e6a590a Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Tue, 3 Feb 2026 20:48:46 -0500 Subject: [PATCH 11/26] docs: update readme with luarocks installation --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 6c4fd1b..1b47a6b 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,21 @@ # midnight.nvim -neovim theme for code, not colors. +Neovim theme for code, not colors. ![Image](https://github.com/user-attachments/assets/9abb5126-15d7-4de4-ad6d-ec35975fec03) ## Installation -Install with any package manager of your choice. For example, with -[lazy.nvim](https://github.com/folke/lazy.nvim): +Install using your package manager of choice or via [luarocks](https://luarocks.org/modules/barrettruth/midnight.nvim): + +``` +luarocks install midnight.nvim +``` + +Then set the colorscheme: ```lua -{ - 'barrettruth/midnight.nvim', - config = function() - vim.cmd.colorscheme('midnight') - end, -} +vim.cmd.colorscheme('midnight') ``` ## Plugin Integration From 6b63011c1c75d101f984f83cf9e51e6c36ecf1d4 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Tue, 3 Feb 2026 20:51:56 -0500 Subject: [PATCH 12/26] format --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1b47a6b..234d9d9 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,8 @@ Neovim theme for code, not colors. ## Installation -Install using your package manager of choice or via [luarocks](https://luarocks.org/modules/barrettruth/midnight.nvim): +Install using your package manager of choice or via +[luarocks](https://luarocks.org/modules/barrettruth/midnight.nvim): ``` luarocks install midnight.nvim @@ -18,7 +19,7 @@ Then set the colorscheme: vim.cmd.colorscheme('midnight') ``` -## Plugin Integration +## Plugin Integrations - [treesitter](https://github.com/nvim-treesitter/nvim-treesitter) - [fzf-lua](https://github.com/ibhagwan/fzf-lua) From 6559261ad57f843dafbee84cc4404aaec7c85ff8 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Tue, 3 Feb 2026 21:07:02 -0500 Subject: [PATCH 13/26] chore: add issue templates --- .github/ISSUE_TEMPLATE/bug_report.yaml | 78 +++++++++++++++++++++ .github/ISSUE_TEMPLATE/config.yaml | 5 ++ .github/ISSUE_TEMPLATE/feature_request.yaml | 30 ++++++++ 3 files changed, 113 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yaml create mode 100644 .github/ISSUE_TEMPLATE/config.yaml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.yaml diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml new file mode 100644 index 0000000..4759413 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -0,0 +1,78 @@ +name: Bug Report +description: Report a bug +title: 'bug: ' +labels: [bug] +body: + - type: checkboxes + attributes: + label: Prerequisites + options: + - label: + I have searched [existing + issues](https://github.com/barrettruth/midnight.nvim/issues) + required: true + - label: I have updated to the latest version + required: true + + - type: textarea + attributes: + label: 'Neovim version' + description: 'Output of `nvim --version`' + render: text + validations: + required: true + + - type: input + attributes: + label: 'Operating system' + placeholder: 'e.g. Arch Linux, macOS 15, Ubuntu 24.04' + validations: + required: true + + - type: textarea + attributes: + label: Description + description: What happened? What did you expect? + validations: + required: true + + - type: textarea + attributes: + label: Steps to reproduce + description: Minimal steps to trigger the bug + value: | + 1. + 2. + 3. + validations: + required: true + + - type: textarea + attributes: + label: 'Health check' + description: 'Output of `:checkhealth midnight`' + render: text + + - type: textarea + attributes: + label: Minimal reproduction + description: | + Save the script below as `repro.lua`, edit if needed, and run: + ``` + nvim -u repro.lua + ``` + Confirm the bug reproduces with this config before submitting. + render: lua + value: | + vim.env.LAZY_STDPATH = '.repro' + load(vim.fn.system('curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua'))() + require('lazy.nvim').setup({ + spec = { + { + 'barrett-ruth/midnight.nvim', + opts = {}, + }, + }, + }) + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/config.yaml b/.github/ISSUE_TEMPLATE/config.yaml new file mode 100644 index 0000000..92bd099 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yaml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: Questions + url: https://github.com/barrettruth/midnight.nvim/discussions + about: Ask questions and discuss ideas diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml new file mode 100644 index 0000000..77998c2 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yaml @@ -0,0 +1,30 @@ +name: Feature Request +description: Suggest a feature +title: 'feat: ' +labels: [enhancement] +body: + - type: checkboxes + attributes: + label: Prerequisites + options: + - label: + I have searched [existing + issues](https://github.com/barrettruth/midnight.nvim/issues) + required: true + + - type: textarea + attributes: + label: Problem + description: What problem does this solve? + validations: + required: true + + - type: textarea + attributes: + label: Proposed solution + validations: + required: true + + - type: textarea + attributes: + label: Alternatives considered From 2702caf35222e6824f02e08a29415a6f1618c979 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Tue, 3 Feb 2026 21:46:43 -0500 Subject: [PATCH 14/26] fix: add deprecation warning for setup() --- lua/midnight/init.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lua/midnight/init.lua b/lua/midnight/init.lua index 50a83ba..1ed25ca 100644 --- a/lua/midnight/init.lua +++ b/lua/midnight/init.lua @@ -17,4 +17,17 @@ function M.load() theme.apply() end +---@deprecated Use `vim.cmd('colorscheme midnight')` instead +function M.setup(opts) + vim.deprecate( + 'require("midnight").setup()', + 'vim.cmd("colorscheme midnight")', + 'v0.1.0', + 'midnight.nvim', + false + ) + + M.load() +end + return M From 94a373f416f2b9ff3a720fbbc59e1229414e5cab Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Tue, 3 Feb 2026 21:51:55 -0500 Subject: [PATCH 15/26] fix: mark opts as intentionally unused --- lua/midnight/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/midnight/init.lua b/lua/midnight/init.lua index 1ed25ca..1055fda 100644 --- a/lua/midnight/init.lua +++ b/lua/midnight/init.lua @@ -18,7 +18,7 @@ function M.load() end ---@deprecated Use `vim.cmd('colorscheme midnight')` instead -function M.setup(opts) +function M.setup(_opts) vim.deprecate( 'require("midnight").setup()', 'vim.cmd("colorscheme midnight")', From 517837c9d36c5ab5c4b22e695359f9b9a4ad0879 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Wed, 4 Feb 2026 15:58:07 -0500 Subject: [PATCH 16/26] feat: add treesitter highlights for diff files Adds support for treesitter-based diff syntax highlighting: - @diff.minus (red) and @diff.plus (green) for changed lines - @attribute.diff (blue) for hunk headers - @string.special.path and @variable.parameter linked to Normal --- lua/midnight/theme.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lua/midnight/theme.lua b/lua/midnight/theme.lua index 25a7a15..d4dffb7 100644 --- a/lua/midnight/theme.lua +++ b/lua/midnight/theme.lua @@ -145,7 +145,10 @@ function M.apply() hi('gitCommitSummary', { fg = cs.background }) - hi('@attribute.diff', { fg = cs.background }) + hi('@attribute.diff', { fg = cs.blue }) + hi('@diff.minus', { fg = cs.red }) + hi('@diff.plus', { fg = cs.green }) + link('Normal', { '@string.special.path', '@variable.parameter' }) hi('DiffAdd', { bg = cs.diff_add, fg = cs.green }, { '@text.diff.add', 'diffAdded' }) hi('DiffDelete', { bg = cs.diff_delete, fg = cs.red }, { '@text.diff.delete', 'diffRemoved' }) hi('DiffChange', { bg = cs.diff_change, fg = cs.blue }) From f28ffed8d94db0ea3e708b510f8c1c131e45d9c4 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Wed, 4 Feb 2026 16:01:18 -0500 Subject: [PATCH 17/26] fix(ci): remove python --- .github/workflows/quality.yaml | 47 ---------------------------------- .pre-commit-config.yaml | 20 --------------- 2 files changed, 67 deletions(-) diff --git a/.github/workflows/quality.yaml b/.github/workflows/quality.yaml index d7be890..dcf74d2 100644 --- a/.github/workflows/quality.yaml +++ b/.github/workflows/quality.yaml @@ -11,7 +11,6 @@ jobs: runs-on: ubuntu-latest outputs: lua: ${{ steps.changes.outputs.lua }} - python: ${{ steps.changes.outputs.python }} markdown: ${{ steps.changes.outputs.markdown }} steps: - uses: actions/checkout@v4 @@ -25,10 +24,6 @@ jobs: - '*.lua' - '.luarc.json' - '*.toml' - python: - - 'scripts/**/*.py' - - 'pyproject.toml' - - 'uv.lock' markdown: - '*.md' @@ -72,48 +67,6 @@ jobs: directories: lua configpath: .luarc.json - python-format: - name: Python Format Check - runs-on: ubuntu-latest - needs: changes - if: ${{ needs.changes.outputs.python == 'true' }} - steps: - - uses: actions/checkout@v4 - - name: Install uv - uses: astral-sh/setup-uv@v4 - - name: Install ruff - run: uv tool install ruff - - name: Check Python formatting with ruff - run: ruff format --check . - - python-lint: - name: Python Lint Check - runs-on: ubuntu-latest - needs: changes - if: ${{ needs.changes.outputs.python == 'true' }} - steps: - - uses: actions/checkout@v4 - - name: Install uv - uses: astral-sh/setup-uv@v4 - - name: Install ruff - run: uv tool install ruff - - name: Lint Python files with ruff - run: ruff check . - - python-typecheck: - name: Python Type Check - runs-on: ubuntu-latest - needs: changes - if: ${{ needs.changes.outputs.python == 'true' }} - steps: - - uses: actions/checkout@v4 - - name: Install uv - uses: astral-sh/setup-uv@v4 - - name: Install dependencies with mypy - run: uv sync --dev - - name: Type check Python files with mypy - run: uv run mypy . - markdown-format: name: Markdown Format Check runs-on: ubuntu-latest diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4706ce4..3477598 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,26 +9,6 @@ repos: files: \.lua$ pass_filenames: true - - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.14.3 - hooks: - - id: ruff-format - name: ruff (format) - files: \.py$ - - id: ruff - name: ruff (lint imports) - args: ['--fix', '--select=I'] - files: \.py$ - - - repo: local - hooks: - - id: mypy - name: mypy (type check) - entry: uv run mypy - language: system - args: ['.'] - pass_filenames: false - - repo: https://github.com/pre-commit/mirrors-prettier rev: v4.0.0-alpha.8 hooks: From 9ff64a7b89d01579b2edd11047e0f586188d2283 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Thu, 5 Feb 2026 00:39:22 -0500 Subject: [PATCH 18/26] misc highlight fixes --- lua/midnight/theme.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/midnight/theme.lua b/lua/midnight/theme.lua index d4dffb7..c32d23c 100644 --- a/lua/midnight/theme.lua +++ b/lua/midnight/theme.lua @@ -148,6 +148,9 @@ function M.apply() hi('@attribute.diff', { fg = cs.blue }) hi('@diff.minus', { fg = cs.red }) hi('@diff.plus', { fg = cs.green }) + hi('@diff.delta', { fg = cs.blue }) + hi('@punctuation.special.diff', { fg = cs.blue }) + link('Normal', { '@string.special.path', '@variable.parameter' }) hi('DiffAdd', { bg = cs.diff_add, fg = cs.green }, { '@text.diff.add', 'diffAdded' }) hi('DiffDelete', { bg = cs.diff_delete, fg = cs.red }, { '@text.diff.delete', 'diffRemoved' }) From 130a1899c2d5a0af431f3e41eeac429e90ea1d09 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Tue, 10 Feb 2026 13:44:36 -0500 Subject: [PATCH 19/26] fix: recursion loading random issue --- lua/midnight/init.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lua/midnight/init.lua b/lua/midnight/init.lua index 1055fda..670aaeb 100644 --- a/lua/midnight/init.lua +++ b/lua/midnight/init.lua @@ -1,7 +1,12 @@ local M = {} +local loading = false + ---@return nil function M.load() + if loading then return end + loading = true + if vim.g.colors_name then vim.cmd('hi clear') end @@ -15,6 +20,8 @@ function M.load() local theme = require('midnight.theme') theme.apply() + + loading = false end ---@deprecated Use `vim.cmd('colorscheme midnight')` instead From fc03b940ded5682665278894b45c23559221264a Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Tue, 17 Feb 2026 19:24:25 -0500 Subject: [PATCH 20/26] fix: format lua and highlight latex functions --- lua/midnight/init.lua | 4 +++- lua/midnight/theme.lua | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/midnight/init.lua b/lua/midnight/init.lua index 670aaeb..41d066f 100644 --- a/lua/midnight/init.lua +++ b/lua/midnight/init.lua @@ -4,7 +4,9 @@ local loading = false ---@return nil function M.load() - if loading then return end + if loading then + return + end loading = true if vim.g.colors_name then diff --git a/lua/midnight/theme.lua b/lua/midnight/theme.lua index c32d23c..a4d786f 100644 --- a/lua/midnight/theme.lua +++ b/lua/midnight/theme.lua @@ -165,6 +165,8 @@ function M.apply() hi('@constructor.lua', { fg = cs.background }) hi('@markup.heading.gitcommit', { none = true }) + hi('@function.latex', { fg = cs.blue }) + hi('GitSignsCurrentLineBlame', { italic = true, fg = cs.light_black }) link('DiffAdd', 'GitSignsAdd') link('DiffChange', 'GitSignsChange') From 638a9e65f30e2d49a9fec231bef91a34aca9f0a2 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Wed, 18 Feb 2026 11:21:58 -0500 Subject: [PATCH 21/26] fix: use plain background for gitsigns highlights Problem: gitsigns groups were linked to DiffAdd/DiffChange/DiffDelete, which have tinted backgrounds that look out of place in the sign column. Solution: define GitSignsAdd, GitSignsChange, and GitSignsDelete with foreground-only highlights so they inherit the normal background. --- lua/midnight/theme.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/midnight/theme.lua b/lua/midnight/theme.lua index a4d786f..e039454 100644 --- a/lua/midnight/theme.lua +++ b/lua/midnight/theme.lua @@ -168,9 +168,9 @@ function M.apply() hi('@function.latex', { fg = cs.blue }) hi('GitSignsCurrentLineBlame', { italic = true, fg = cs.light_black }) - link('DiffAdd', 'GitSignsAdd') - link('DiffChange', 'GitSignsChange') - link('DiffDelete', 'GitSignsDelete') + hi('GitSignsAdd', { fg = cs.green }) + hi('GitSignsChange', { fg = cs.blue }) + hi('GitSignsDelete', { fg = cs.red }) link('Search', 'HighlightUndo') From 7891879b4e7ba183f377369beb094450d115bb4b Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Fri, 20 Feb 2026 20:18:23 -0500 Subject: [PATCH 22/26] feat: blink-cmp-git integration --- lua/midnight/theme.lua | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/lua/midnight/theme.lua b/lua/midnight/theme.lua index e039454..1fbfa02 100644 --- a/lua/midnight/theme.lua +++ b/lua/midnight/theme.lua @@ -121,9 +121,13 @@ function M.apply() hi('@variable', { none = true }) - hi('Pmenu', { bg = cs.dark_grey }, { 'PmenuSbar' }) + hi('Pmenu', { fg = cs.background, bg = cs.foreground }, { 'PmenuSbar' }) hi('PmenuSel', { bg = cs.med_grey }) hi('PmenuThumb', { bg = cs.grey }) + hi('BlinkCmpMenu', { fg = cs.background, bg = cs.foreground }) + hi('BlinkCmpMenuBorder', { fg = cs.background, bg = cs.foreground }) + hi('BlinkCmpDoc', { fg = cs.background, bg = cs.foreground }) + hi('BlinkCmpDocBorder', { fg = cs.background, bg = cs.foreground }) hi('LspInlayHint', { fg = cs.light_black }) hi('LspSignatureActiveParameter', { underline = true, italic = true }) @@ -179,6 +183,23 @@ function M.apply() hi('CmpItemAbbr', { fg = cs.background }) hi('CmpItemAbbrMatch', { fg = cs.background, bold = true }) hi('CmpItemAbbrMatchFuzzy', { fg = cs.background, bold = true }) + hi('BlinkCmpLabelMatch', { fg = cs.green }) + hi('BlinkCmpGhostText', { fg = cs.light_black }) + hi('BlinkCmpGitKindMR', { fg = cs.magenta }) + hi('BlinkCmpGitKindPR', { fg = cs.magenta }) + hi('BlinkCmpGitKindIssue', { fg = cs.magenta }) + hi('BlinkCmpGitKindCommit', { fg = cs.magenta }) + hi('BlinkCmpGitKindMention', { fg = cs.magenta }) + hi('BlinkCmpGitKindIconMR', { fg = cs.magenta }) + hi('BlinkCmpGitKindIconPR', { fg = cs.magenta }) + hi('BlinkCmpGitKindIconIssue', { fg = cs.magenta }) + hi('BlinkCmpGitKindIconCommit', { fg = cs.magenta }) + hi('BlinkCmpGitKindIconMention', { fg = cs.magenta }) + hi('BlinkCmpGitLabelMRId', { fg = cs.magenta }) + hi('BlinkCmpGitLabelPRId', { fg = cs.magenta }) + hi('BlinkCmpGitLabelIssueId', { fg = cs.magenta }) + hi('BlinkCmpGitLabelCommitId', { fg = cs.magenta }) + hi('BlinkCmpGitLabelMentionId', { fg = cs.magenta }) hi('CmpItemAbbrDeprecated', { fg = cs.light_black, strikethrough = true }) hi('CmpItemMenu', { fg = cs.light_black }) From f52dd06c2660ef66ee8c5aef59f08411410e55b9 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Mon, 23 Feb 2026 17:35:26 -0500 Subject: [PATCH 23/26] build(flake): add nix devShell Problem: no nix dev shell existed, making it harder to get local tooling for formatting, linting, and type checking. Solution: add a flake with a devShell providing prettier, stylua, selene, and lua-language-server. --- flake.nix | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 flake.nix diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..8589f5a --- /dev/null +++ b/flake.nix @@ -0,0 +1,30 @@ +{ + description = "midnight.nvim — a dark colorscheme for Neovim"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + systems.url = "github:nix-systems/default"; + }; + + outputs = + { + nixpkgs, + systems, + ... + }: + let + forEachSystem = f: nixpkgs.lib.genAttrs (import systems) (system: f nixpkgs.legacyPackages.${system}); + in + { + devShells = forEachSystem (pkgs: { + default = pkgs.mkShell { + packages = [ + pkgs.prettier + pkgs.stylua + pkgs.selene + pkgs.lua-language-server + ]; + }; + }); + }; +} From af0a44bec80ed1fb1ff0dbcd3f3336ef8750ec8a Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Mon, 23 Feb 2026 18:14:20 -0500 Subject: [PATCH 24/26] ci: migrate to nix --- .github/workflows/quality.yaml | 29 ++++++----------------- .gitignore | 3 +++ .luarc.json | 2 +- flake.lock | 43 ++++++++++++++++++++++++++++++++++ selene.toml | 3 +++ vim.toml | 30 ------------------------ vim.yaml | 24 +++++++++++++++++++ 7 files changed, 81 insertions(+), 53 deletions(-) create mode 100644 flake.lock delete mode 100644 vim.toml create mode 100644 vim.yaml diff --git a/.github/workflows/quality.yaml b/.github/workflows/quality.yaml index dcf74d2..e43f71c 100644 --- a/.github/workflows/quality.yaml +++ b/.github/workflows/quality.yaml @@ -24,6 +24,7 @@ jobs: - '*.lua' - '.luarc.json' - '*.toml' + - 'vim.yaml' markdown: - '*.md' @@ -34,11 +35,8 @@ jobs: if: ${{ needs.changes.outputs.lua == 'true' }} steps: - uses: actions/checkout@v4 - - uses: JohnnyMorganz/stylua-action@v4 - with: - token: ${{ secrets.GITHUB_TOKEN }} - version: 2.1.0 - args: --check . + - uses: cachix/install-nix-action@v31 + - run: nix develop --command stylua --check . lua-lint: name: Lua Lint Check @@ -47,11 +45,8 @@ jobs: if: ${{ needs.changes.outputs.lua == 'true' }} steps: - uses: actions/checkout@v4 - - name: Lint with Selene - uses: NTBBloodbath/selene-action@v1.0.0 - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: --display-style quiet . + - uses: cachix/install-nix-action@v31 + - run: nix develop --command selene --display-style quiet . lua-typecheck: name: Lua Type Check @@ -74,15 +69,5 @@ jobs: if: ${{ needs.changes.outputs.markdown == 'true' }} steps: - uses: actions/checkout@v4 - - name: Setup pnpm - uses: pnpm/action-setup@v4 - with: - version: 8 - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: '20' - - name: Install prettier - run: pnpm add -g prettier@3.1.0 - - name: Check markdown formatting with prettier - run: prettier --check . + - uses: cachix/install-nix-action@v31 + - run: nix develop --command prettier --check . diff --git a/.gitignore b/.gitignore index 7451084..d13bcc9 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,6 @@ venv/ CLAUDE.md __pycache__ node_modules/ + +.direnv/ +.envrc diff --git a/.luarc.json b/.luarc.json index 3ccfeda..19558f6 100644 --- a/.luarc.json +++ b/.luarc.json @@ -1,5 +1,5 @@ { - "runtime.version": "Lua 5.1", + "runtime.version": "LuaJIT", "runtime.path": ["lua/?.lua", "lua/?/init.lua"], "diagnostics.globals": ["vim"], "workspace.library": ["$VIMRUNTIME/lua", "${3rd}/luv/library"], diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..b6f667a --- /dev/null +++ b/flake.lock @@ -0,0 +1,43 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1771423170, + "narHash": "sha256-K7Dg9TQ0mOcAtWTO/FX/FaprtWQ8BmEXTpLIaNRhEwU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "bcc4a9d9533c033d806a46b37dc444f9b0da49dd", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "systems": "systems" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/selene.toml b/selene.toml index 96cf5ab..f2ada4b 100644 --- a/selene.toml +++ b/selene.toml @@ -1 +1,4 @@ std = 'vim' + +[lints] +bad_string_escape = 'allow' diff --git a/vim.toml b/vim.toml deleted file mode 100644 index 8bf26ea..0000000 --- a/vim.toml +++ /dev/null @@ -1,30 +0,0 @@ -[selene] -base = "lua51" -name = "vim" - -[vim] -any = true - -[jit] -any = true - -[assert] -any = true - -[describe] -any = true - -[it] -any = true - -[before_each] -any = true - -[after_each] -any = true - -[spy] -any = true - -[stub] -any = true diff --git a/vim.yaml b/vim.yaml new file mode 100644 index 0000000..401fce6 --- /dev/null +++ b/vim.yaml @@ -0,0 +1,24 @@ +--- +base: lua51 +name: vim +lua_versions: + - luajit +globals: + vim: + any: true + jit: + any: true + assert: + any: true + describe: + any: true + it: + any: true + before_each: + any: true + after_each: + any: true + spy: + any: true + stub: + any: true From 6b1ba1f056743c91812c770da7086e69001ac9a3 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Wed, 4 Mar 2026 13:50:44 -0500 Subject: [PATCH 25/26] ci: scripts + format --- .luarc.json | 1 + .styluaignore | 1 + scripts/ci.sh | 7 +++++++ vim.yaml | 2 ++ 4 files changed, 11 insertions(+) create mode 100644 .styluaignore create mode 100755 scripts/ci.sh diff --git a/.luarc.json b/.luarc.json index 19558f6..e240dd5 100644 --- a/.luarc.json +++ b/.luarc.json @@ -4,5 +4,6 @@ "diagnostics.globals": ["vim"], "workspace.library": ["$VIMRUNTIME/lua", "${3rd}/luv/library"], "workspace.checkThirdParty": false, + "workspace.ignoreDir": [".direnv"], "completion.callSnippet": "Replace" } diff --git a/.styluaignore b/.styluaignore new file mode 100644 index 0000000..9b42106 --- /dev/null +++ b/.styluaignore @@ -0,0 +1 @@ +.direnv/ diff --git a/scripts/ci.sh b/scripts/ci.sh new file mode 100755 index 0000000..7b5f52b --- /dev/null +++ b/scripts/ci.sh @@ -0,0 +1,7 @@ +#!/bin/sh +set -eu + +nix develop --command stylua --check . +git ls-files '*.lua' | xargs nix develop --command selene --display-style quiet +nix develop --command prettier --check . +nix develop --command lua-language-server --check . --checklevel=Warning diff --git a/vim.yaml b/vim.yaml index 401fce6..3821d25 100644 --- a/vim.yaml +++ b/vim.yaml @@ -22,3 +22,5 @@ globals: any: true stub: any: true + bit: + any: true From 26fb9ca518cc0353bc1f967bfc34ebcc51e0d076 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Wed, 4 Mar 2026 14:12:41 -0500 Subject: [PATCH 26/26] ci: nix --- flake.nix | 5 ++++- scripts/ci.sh | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 8589f5a..18752aa 100644 --- a/flake.nix +++ b/flake.nix @@ -13,9 +13,12 @@ ... }: let - forEachSystem = f: nixpkgs.lib.genAttrs (import systems) (system: f nixpkgs.legacyPackages.${system}); + forEachSystem = + f: nixpkgs.lib.genAttrs (import systems) (system: f nixpkgs.legacyPackages.${system}); in { + formatter = forEachSystem (pkgs: pkgs.nixfmt-tree); + devShells = forEachSystem (pkgs: { default = pkgs.mkShell { packages = [ diff --git a/scripts/ci.sh b/scripts/ci.sh index 7b5f52b..18dc321 100755 --- a/scripts/ci.sh +++ b/scripts/ci.sh @@ -4,4 +4,6 @@ set -eu nix develop --command stylua --check . git ls-files '*.lua' | xargs nix develop --command selene --display-style quiet nix develop --command prettier --check . +nix fmt +git diff --exit-code -- '*.nix' nix develop --command lua-language-server --check . --checklevel=Warning