Displays Git blame information as virtual text in Neovim, line by line. Allows you to customize colors, enable/disable, and show the cache in a floating window.
- 📊 Git blame visualization on current line using virtual text
- 💾 Local cache per line to minimize Git calls
- 🪟 Floating popup with full blame cache
- 🎨 Configurable colors and styles
- 🔄 Auto-applies highlights when changing colorscheme
- ⚡ Easy toggle with command
:GitBlameToggle - ⏱️ Lazy loading for fast startup
- 🩺 Health check with
:checkhealth gitb
- Neovim >= 0.9.0
- Git installed and available in PATH
With your favorite plugin manager:
[lazy.nvim]
{
"Damet24/gitb.nvim",
config = function()
require("gitb_nvim").setup()
end
}[packer.nvim]
use {
"Damet24/gitb.nvim",
config = function()
require("gitb_nvim").setup()
end
}:GitBlameTogglerequire("gitb_nvim").showCachePopup()All options are passed through a single setup() object:
require("gitb_nvim").setup({
enabled = true, -- start enabled
highlights = {
author = { fg = "#FF0000", bold = true },
date = { fg = "#00FF00", italic = true },
msg = { fg = "#0000FF" },
},
popup = {
max_width = 100, -- maximum width of floating window
max_height = 20, -- maximum height of floating window
border = "double", -- border style: "rounded", "single", "double", etc.
},
})| Option | Type | Default | Description |
|---|---|---|---|
enabled |
boolean | false |
Start the plugin enabled |
highlights.author |
table | { fg = colors.Comment, bold = true } |
Color and style of the author |
highlights.date |
table | { fg = colors.Identifier, italic = true } |
Color and style of the date |
highlights.msg |
table | { fg = colors.Normal } |
Color of the message |
popup.max_width |
number | 80 |
Maximum width of the popup |
popup.max_height |
number | 15 |
Maximum height of the popup |
popup.border |
string | "rounded" |
Border style ("rounded", "single", "double", "shadow", etc.) |
You can customize highlights directly: >
vim.api.nvim_set_hl(0, "GitBlameAuthor", { fg = "#FFA500", bold = true }) vim.api.nvim_set_hl(0, "GitBlameDate", { fg = "#00FFFF", italic = true }) vim.api.nvim_set_hl(0, "GitBlameMsg", { fg = "#FFFFFF" }) <
require("gitb_nvim").setup({
enabled = true,
highlights = {
author = { fg = "#FFA500", bold = true },
date = { fg = "#00FFFF", italic = true },
msg = { fg = "#FFFFFF" },
},
popup = {
max_width = 80,
max_height = 15,
border = "rounded",
},
})
