oil-git-status.nvim
February 11, 2026 ยท View on GitHub
Add Git Status to oil.nvim directory listings. Git status is added to the listing asynchronously after creating the oil directory listing so it won't slow oil down on big repositories. The plugin puts the status in two new sign columns, the left being the status of the index, the right being the status of the working directory, just as you'd get if you ran git status --short.
Configuration
Change the oil configuration to allow at least 2 sign columns:
require("oil").setup({
win_options = {
signcolumn = "yes:2",
},
})
Lazy
{
"refractalize/oil-git-status.nvim",
dependencies = {
"stevearc/oil.nvim",
},
config = true,
},
Packer
use {
'refractalize/oil-git-status.nvim',
after = {
"oil.nvim",
},
config = function()
require("oil-git-status").setup()
end,
}
Default Config
require('oil-git-status').setup({
show_ignored = true -- show files that match gitignore with !!
symbols = { -- customize the symbols that appear in the git status columns
index = {
["!"] = "!",
["?"] = "?",
["A"] = "A",
["C"] = "C",
["D"] = "D",
["M"] = "M",
["R"] = "R",
["T"] = "T",
["U"] = "U",
[" "] = " ",
},
working_tree = {
["!"] = "!",
["?"] = "?",
["A"] = "A",
["C"] = "C",
["D"] = "D",
["M"] = "M",
["R"] = "R",
["T"] = "T",
["U"] = "U",
[" "] = " ",
},
},
})
API
Highlight Groups
The following highlight groups are defined:
| Status Code | In Index | In Working Tree |
|---|---|---|
| OilGitStatusIndexUnmodified | OilGitStatusWorkingTreeUnmodified |
! | OilGitStatusIndexIgnored | OilGitStatusWorkingTreeIgnored |
? | OilGitStatusIndexUntracked | OilGitStatusWorkingTreeUntracked |
A | OilGitStatusIndexAdded | OilGitStatusWorkingTreeAdded |
C | OilGitStatusIndexCopied | OilGitStatusWorkingTreeCopied |
D | OilGitStatusIndexDeleted | OilGitStatusWorkingTreeDeleted |
M | OilGitStatusIndexModified | OilGitStatusWorkingTreeModified |
R | OilGitStatusIndexRenamed | OilGitStatusWorkingTreeRenamed |
T | OilGitStatusIndexTypeChanged | OilGitStatusWorkingTreeTypeChanged |
U | OilGitStatusIndexUnmerged | OilGitStatusWorkingTreeUnmerged |
You can access these programmatically through the require('oil-git-status').highlight_groups field:
for _, hl_group in pairs(require("oil-git-status").highlight_groups) do
if hl_group.index then
vim.api.nvim_set_hl(0, hl_group.hl_group, { fg = "#ff0000" })
else
vim.api.nvim_set_hl(0, hl_group.hl_group, { fg = "#00ff00" })
end
end
Refresh Oil Buffer Git Status
local oil_git_status = require("oil-git-status")
oil_git_status.refresh_buffer(bufnr)