From 0a3b973717cf33759da28a5f78a77f31b928f8ab Mon Sep 17 00:00:00 2001 From: Jacob Scott Date: Sat, 4 Oct 2025 23:34:57 +0100 Subject: [PATCH 1/4] feat: expose highlight groups NeogitNormalFloat and NeogitFloatBorder --- lua/neogit/lib/buffer.lua | 2 ++ lua/neogit/lib/hl.lua | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lua/neogit/lib/buffer.lua b/lua/neogit/lib/buffer.lua index 562e7e5af..f0b51d181 100644 --- a/lua/neogit/lib/buffer.lua +++ b/lua/neogit/lib/buffer.lua @@ -779,6 +779,8 @@ function Buffer.create(config) buffer:call(function() vim.opt_local.winhl:append("Folded:NeogitFold") vim.opt_local.winhl:append("Normal:NeogitNormal") + vim.opt_local.winhl:append("NormalFloat:NeogitNormalFloat") + vim.opt_local.winhl:append("FloatBorder:NeogitFloatBorder") vim.opt_local.winhl:append("WinSeparator:NeogitWinSeparator") vim.opt_local.winhl:append("CursorLineNr:NeogitCursorLineNr") vim.opt_local.fillchars:append("fold: ") diff --git a/lua/neogit/lib/hl.lua b/lua/neogit/lib/hl.lua index 658e32773..0650d0e29 100644 --- a/lua/neogit/lib/hl.lua +++ b/lua/neogit/lib/hl.lua @@ -179,6 +179,8 @@ function M.setup(config) NeogitSignatureGoodExpiredKey = { link = "NeogitGraphYellow" }, NeogitSignatureGoodRevokedKey = { link = "NeogitGraphRed" }, NeogitNormal = { link = "Normal" }, + NeogitNormalFloat = { link = "NeogitNormal" }, + NeogitFloatBorder = { link = "NeogitNormalFloat" }, NeogitCursorLine = { link = "CursorLine" }, NeogitCursorLineNr = { link = "CursorLineNr" }, NeogitHunkMergeHeader = { fg = palette.bg2, bg = palette.grey, bold = palette.bold }, From 6b9d19cefd026728aa524998325973c90e4a9d49 Mon Sep 17 00:00:00 2001 From: Jacob Scott Date: Sun, 5 Oct 2025 00:00:20 +0100 Subject: [PATCH 2/4] feat: expose NeogitSignColumn highlight group --- lua/neogit/lib/buffer.lua | 1 + lua/neogit/lib/hl.lua | 1 + 2 files changed, 2 insertions(+) diff --git a/lua/neogit/lib/buffer.lua b/lua/neogit/lib/buffer.lua index f0b51d181..c36bbfb80 100644 --- a/lua/neogit/lib/buffer.lua +++ b/lua/neogit/lib/buffer.lua @@ -781,6 +781,7 @@ function Buffer.create(config) vim.opt_local.winhl:append("Normal:NeogitNormal") vim.opt_local.winhl:append("NormalFloat:NeogitNormalFloat") vim.opt_local.winhl:append("FloatBorder:NeogitFloatBorder") + vim.opt_local.winhl:append("SignColumn:NeogitSignColumn") vim.opt_local.winhl:append("WinSeparator:NeogitWinSeparator") vim.opt_local.winhl:append("CursorLineNr:NeogitCursorLineNr") vim.opt_local.fillchars:append("fold: ") diff --git a/lua/neogit/lib/hl.lua b/lua/neogit/lib/hl.lua index 0650d0e29..b0f0d9354 100644 --- a/lua/neogit/lib/hl.lua +++ b/lua/neogit/lib/hl.lua @@ -181,6 +181,7 @@ function M.setup(config) NeogitNormal = { link = "Normal" }, NeogitNormalFloat = { link = "NeogitNormal" }, NeogitFloatBorder = { link = "NeogitNormalFloat" }, + NeogitSignColumn = { link = "NeogitNormal" }, NeogitCursorLine = { link = "CursorLine" }, NeogitCursorLineNr = { link = "CursorLineNr" }, NeogitHunkMergeHeader = { fg = palette.bg2, bg = palette.grey, bold = palette.bold }, From df90d5d6eec4bb98dc7f82ba6ae810a94f6db8a5 Mon Sep 17 00:00:00 2001 From: Jacob Scott Date: Sun, 5 Oct 2025 00:13:29 +0100 Subject: [PATCH 3/4] feat: expose highlight group NeogitSignColum --- lua/neogit/lib/buffer.lua | 3 ++- lua/neogit/lib/hl.lua | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lua/neogit/lib/buffer.lua b/lua/neogit/lib/buffer.lua index c36bbfb80..1d1bdeb4b 100644 --- a/lua/neogit/lib/buffer.lua +++ b/lua/neogit/lib/buffer.lua @@ -778,10 +778,11 @@ function Buffer.create(config) buffer:set_window_option("list", false) buffer:call(function() vim.opt_local.winhl:append("Folded:NeogitFold") + vim.opt_local.winhl:append("FoldColumn:NeogitFoldColumn") + vim.opt_local.winhl:append("SignColumn:NeogitSignColumn") vim.opt_local.winhl:append("Normal:NeogitNormal") vim.opt_local.winhl:append("NormalFloat:NeogitNormalFloat") vim.opt_local.winhl:append("FloatBorder:NeogitFloatBorder") - vim.opt_local.winhl:append("SignColumn:NeogitSignColumn") vim.opt_local.winhl:append("WinSeparator:NeogitWinSeparator") vim.opt_local.winhl:append("CursorLineNr:NeogitCursorLineNr") vim.opt_local.fillchars:append("fold: ") diff --git a/lua/neogit/lib/hl.lua b/lua/neogit/lib/hl.lua index b0f0d9354..b8504451a 100644 --- a/lua/neogit/lib/hl.lua +++ b/lua/neogit/lib/hl.lua @@ -181,7 +181,7 @@ function M.setup(config) NeogitNormal = { link = "Normal" }, NeogitNormalFloat = { link = "NeogitNormal" }, NeogitFloatBorder = { link = "NeogitNormalFloat" }, - NeogitSignColumn = { link = "NeogitNormal" }, + NeogitSignColumn = { fg = "None", bg = "None" }, NeogitCursorLine = { link = "CursorLine" }, NeogitCursorLineNr = { link = "CursorLineNr" }, NeogitHunkMergeHeader = { fg = palette.bg2, bg = palette.grey, bold = palette.bold }, @@ -235,6 +235,7 @@ function M.setup(config) NeogitStash = { link = "NeogitSubtleText" }, NeogitRebaseDone = { link = "NeogitSubtleText" }, NeogitFold = { fg = "None", bg = "None" }, + NeogitFoldColumn = { fg = "None", bg = "None" }, NeogitWinSeparator = { link = "WinSeparator" }, NeogitChangeMuntracked = { link = "NeogitChangeModified" }, NeogitChangeAuntracked = { link = "NeogitChangeAdded" }, From 4c0724409e9336f7e4f5c75f51a5f448e80b0012 Mon Sep 17 00:00:00 2001 From: Jacob Scott Date: Sun, 5 Oct 2025 00:13:57 +0100 Subject: [PATCH 4/4] docs: describe new highlight groups --- doc/neogit.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/doc/neogit.txt b/doc/neogit.txt index 5616a1d92..29d37a0c6 100644 --- a/doc/neogit.txt +++ b/doc/neogit.txt @@ -174,7 +174,7 @@ to Neovim users. initial_branch_name = "", -- Change the default way of opening neogit kind = "tab", - -- Floating window style + -- Floating window style floating = { relative = "editor", width = 0.8, @@ -680,12 +680,17 @@ these yourself before the plugin loads, that will be respected. If they do not exist, they will be created with sensible defaults based on your colorscheme. STATUS BUFFER +NeogitNormal Normal text +NeogitFloat Normal text when using a floating window +NeogitFloatBorder Border wen using a floating window NeogitBranch Local branches NeogitBranchHead Accent highlight for current HEAD in LogBuffer NeogitRemote Remote branches NeogitObjectId Object's SHA hash NeogitStash Stash name NeogitFold Folded text highlight +NeogitFoldColumn Column where folds are displayed +NeogitSignColumn Column where signs are displayed NeogitRebaseDone Current position within rebase NeogitTagName Closest Tag name NeogitTagDistance Number of commits between the tag and HEAD @@ -2256,7 +2261,7 @@ Customizing Popups *neogit_custom_popups* You can customize existing popups via the Neogit config. -Below is an example of adding a custom switch, but you can use any function +Below is an example of adding a custom switch, but you can use any function from the builder API. >lua require("neogit").setup({