# git.nvim A git workflow integration for Neovim. Features: - Status sidebar with stage/unstage/discard actions - Log viewer - Diff splits against any revision, the index, or the worktree - Gutter signs + optional diff overlay - Per-hunk stage / reset / preview / select - Blame: cursor-line popup, inline annotation, full-file gutter - Commit proxy (compose in a Neovim buffer) - Generic `:G ` runner - `git://:` URIs (worktree, index, stages, blobs, bare objects) Requires Neovim v0.12+ and git v2.25+. ## Install The plugin auto-initializes from its `plugin/git.lua` and exposes `lua/git/`. No `setup()` call is required. With `vim.pack`: ```lua vim.pack.add({ "https://git.owall.se/warg/git.nvim" }) ``` ## Commands | Command | Action | | -------------------------------------------- | ---------------------------------------------- | | `:G[!] [args...]` | Generic git runner | | `:Grefresh` | Refresh git status for all repos | | `:Glog [args...]` | Open the log viewer | | `:Gdiffsplit [vertical\|horizontal] []` | Open a diff split (default vertical, vs index) | | `:Gedit [:path]` | Open an object as a buffer (`git://` URI) | | `:Gstatus [sidebar\|split\|current]` | Open the status view (default `split`) | | `:GitDiffOverlay` | Toggle the in-buffer diff overlay | ## `` mappings | Plug map | Action | | --------------------------------------- | ------------------------------------- | | `(git-status-toggle)` | Toggle status sidebar | | `(git-log)` | Open log viewer | | `(git-commit)` | Compose a commit | | `(git-commit-amend)` | Amend the last commit | | `(git-diffsplit-vertical)` | Vertical diff vs index | | `(git-diffsplit-vertical-head)` | Vertical diff vs HEAD | | `(git-diffsplit-horizontal)` | Horizontal diff vs index | | `(git-diffsplit-horizontal-head)` | Horizontal diff vs HEAD | | `(git-blame-popup)` | Cursor-line blame popup | | `(git-blame-view)` | Toggle full-file blame overlay | | `(git-hunk-select)` | Visually select the hunk under cursor | | `(git-hunk-stage-toggle)` | Stage / unstage hunk | | `(git-hunk-reset)` | Reset hunk | | `(git-hunk-overlay-toggle)` | Toggle the in-buffer diff overlay | | `(git-hunk-next)` | Jump to next hunk | | `(git-hunk-prev)` | Jump to previous hunk | Bind one with e.g. ```lua vim.keymap.set("n", "gg", "(git-status-toggle)") ``` ## Globals - `vim.g.loaded_git = 1`: skip auto-initialization (set before the plugin loads). - `vim.g.git_hunk_signs = { add?, change?, delete? }`: override the gutter glyphs (default `┃`). ## Highlight groups See the `DEFAULT_HIGHLIGHTS` table for the full list.