oil-git.nvim
March 17, 2026 ยท View on GitHub
Git status integration for oil.nvim - colors file/directory names and adds status symbols.
Note
malewicz1337/oil-git.nvim is the successor to benomahony/oil-git.nvim. It was created to provide a maintained, high-performance alternative with async support, directory highlighting, and debouncing.
![]() |
![]() |
Features
- File & directory highlighting - Instant visual feedback based on git status.
- Status symbols - Customizable symbols (added, modified, deleted, etc.) at the end of lines.
- Async & debounced - Non-blocking execution ensures zero lag even in massive repositories with deep directory structures.
- Smart Refresh - Auto-updates on buffer entry, file operations, and after closing terminal toggles (like LazyGit).
Installation
lazy.nvim (no setup required):
{ "malewicz1337/oil-git.nvim", dependencies = { "stevearc/oil.nvim" } }
With custom options (as oil.nvim dependency)
This is how I use the plugin in my config:
{
"stevearc/oil.nvim",
dependencies = {
{ "echasnovski/mini.icons", opts = {} },
{
"malewicz1337/oil-git.nvim",
dependencies = { "stevearc/oil.nvim" },
opts = {
show_file_highlights = true,
show_directory_highlights = false,
show_ignored_files = true,
},
},
},
config = function()
require("oil").setup({
...
})
end,
}
Other plugin managers
Packer:
use { "malewicz1337/oil-git.nvim", requires = { "stevearc/oil.nvim" } }
vim-plug:
Plug 'stevearc/oil.nvim'
Plug 'malewicz1337/oil-git.nvim'
Configuration
All options with defaults:
require("oil-git").setup({
debounce_ms = 50,
show_file_highlights = true,
show_directory_highlights = true,
show_file_symbols = true,
show_directory_symbols = true,
show_ignored_files = false, -- Show ignored file status
show_ignored_directories = false, -- Show ignored directory status
symbol_position = "eol", -- "eol", "signcolumn", or "none"
can_use_signcolumn = nil, -- Optional callback(bufnr): nil|bool|string
ignore_gitsigns_update = false, -- Ignore GitSignsUpdate events (fallback for flickering)
debug = false, -- false, "minimal", or "verbose"
symbols = {
file = { added = "+", modified = "~", renamed = "->", deleted = "D",
copied = "C", conflict = "!", untracked = "?", ignored = "o" },
directory = { added = "*", modified = "*", renamed = "*", deleted = "*",
copied = "*", conflict = "!", untracked = "*", ignored = "o" },
},
-- Colors (only applied if highlight groups don't exist)
highlights = {
OilGitAdded = { fg = "#a6e3a1" },
OilGitModifiedStaged = { fg = "#f9e2af" },
OilGitModifiedUnstaged = { fg = "#e5c890" },
OilGitRenamed = { fg = "#cba6f7" },
OilGitDeleted = { fg = "#f38ba8" },
OilGitCopied = { fg = "#cba6f7" },
OilGitConflict = { fg = "#fab387" },
OilGitUntracked = { fg = "#89b4fa" },
OilGitIgnored = { fg = "#6c7086" },
},
})
Signcolumn callback
When symbol_position = "signcolumn", you can optionally provide
can_use_signcolumn = function(bufnr) ... end to control behavior per buffer.
- Return
nilto use the default oil.nvim compatibility check. - Return
trueto force signcolumn symbols on. - Return
falseto force signcolumn symbols off. - Return a string (for example
"yes:2") to force signcolumn symbols on and set the windowsigncolumnvalue when symbols are present.
Git Status Reference
| Status | File Symbol | Color | Description |
|---|---|---|---|
| Added | + | Green | Staged new file |
| Modified (staged) | ~ | Yellow | Changes staged in the index |
| Modified (unstaged) | ~ | Gold | Changes only in the worktree |
| Renamed | -> | Purple | Renamed file |
| Deleted | D | Red | Deleted file |
| Copied | C | Purple | Copied file |
| Conflict | ! | Orange | Merge conflict |
| Untracked | ? | Blue | New untracked file |
| Ignored | o | Gray | Ignored file |
Directory Status Priority
Directories show the highest-priority status among their contents:
| Priority | Status | Description |
|---|---|---|
| 8 | Conflict | Merge conflicts need immediate attention |
| 7 | Modified (staged) | Staged changes take precedence in directories |
| 6 | Modified (unstaged) | Worktree-only changes |
| 5 | Deleted | Deleted files |
| 4 | Added | New staged files |
| 3 | Renamed/Copied | Renamed or copied files |
| 2 | Untracked | New untracked files |
| 1 | Ignored | Only shown when show_ignored_directories = true |
Usage
:lua require("oil-git").refresh()- Manual refresh:checkhealth oil-git- Check plugin health
Status auto-refreshes on buffer enter, file operations, focus changes, and terminal close (LazyGit, etc.).
Requirements
- Neovim >= 0.8
- oil.nvim
- Git
Credits
- benomahony/oil-git.nvim - Original project this fork is based on
- oil.nvim by stevearc - The file explorer this plugin extends

