{"id":29396212,"url":"https://github.com/axkirillov/unified.nvim","last_synced_at":"2026-01-21T13:25:25.215Z","repository":{"id":285263844,"uuid":"954546253","full_name":"axkirillov/unified.nvim","owner":"axkirillov","description":"an inline, unified diff viewer for neovim","archived":false,"fork":false,"pushed_at":"2026-01-15T08:46:47.000Z","size":272,"stargazers_count":121,"open_issues_count":11,"forks_count":8,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-15T14:55:52.344Z","etag":null,"topics":["neovim","neovim-plugin","plugin"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/axkirillov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-03-25T08:49:24.000Z","updated_at":"2026-01-15T08:46:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"8cef5711-cf3a-466d-83bf-fcae6d0fef08","html_url":"https://github.com/axkirillov/unified.nvim","commit_stats":null,"previous_names":["axkirillov/unified.nvim"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/axkirillov/unified.nvim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axkirillov%2Funified.nvim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axkirillov%2Funified.nvim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axkirillov%2Funified.nvim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axkirillov%2Funified.nvim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/axkirillov","download_url":"https://codeload.github.com/axkirillov/unified.nvim/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axkirillov%2Funified.nvim/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28587226,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T20:45:59.482Z","status":"ssl_error","status_checked_at":"2026-01-19T20:45:41.500Z","response_time":67,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["neovim","neovim-plugin","plugin"],"created_at":"2025-07-10T12:01:39.926Z","updated_at":"2026-01-19T22:17:40.968Z","avatar_url":"https://github.com/axkirillov.png","language":"Lua","readme":"# unified.nvim\n\nA Neovim plugin for displaying inline unified diffs directly in your buffer.\n\n\u003cimg width=\"1840\" alt=\"image\" src=\"https://github.com/user-attachments/assets/7655659e-c8af-40c5-ad70-59f67a2b16d9\" /\u003e\n\n## Features\n\n* **Inline Diffs**: View git diffs directly in your buffer, without needing a separate window.\n* **File Tree Explorer**: A file tree explorer is displayed, showing all files that have been changed.\n* **Git Gutter Signs**: Gutter signs are used to indicate added, modified, and deleted lines.\n* **Customizable**: Configure the signs, highlights, and line symbols to your liking.\n* **Auto-refresh**: The diff view automatically refreshes as you make changes to the buffer.\n\n## Requirements\n\n-   Neovim \u003e= 0.5.0\n-   Git\n-   A [Nerd Font](https://www.nerdfonts.com/) installed and configured in your terminal/GUI is required to display file icons correctly in the file tree.\n\n## Installation\n\nYou can install `unified.nvim` using your favorite plugin manager.\n\n### [lazy.nvim](https://github.com/folke/lazy.nvim)\n\n```lua\n{\n  'axkirillov/unified.nvim',\n  opts = {\n    -- your configuration comes here\n  }\n}\n```\n\n### [packer.nvim](https://github.com/wbthomason/packer.nvim)\n\n```lua\nuse {\n  'axkirillov/unified.nvim',\n  config = function()\n    require('unified').setup({\n      -- your configuration comes here\n    })\n  end\n}\n```\n\n## Configuration\n\nYou can configure `unified.nvim` by passing a table to the `setup()` function. Here are the default settings:\n\n```lua\nrequire('unified').setup({\n  signs = {\n    add = \"│\",\n    delete = \"│\",\n    change = \"│\",\n  },\n  highlights = {\n    add = \"DiffAdd\",\n    delete = \"DiffDelete\",\n    change = \"DiffChange\",\n  },\n  line_symbols = {\n    add = \"+\",\n    delete = \"-\",\n    change = \"~\",\n  },\n  auto_refresh = true, -- Whether to automatically refresh diff when buffer changes\n})\n```\n\n## Usage\n\n1.  Open a file in a git repository.\n2.  Make some changes to the file.\n3.  Run the command `:Unified` to display the diff against `HEAD` and open the file tree.\n4.  To close the diff view and file tree, run `:Unified` again.\n5.  To show the diff against a specific commit, run `:Unified \u003ccommit_ref\u003e`, for example `:Unified HEAD~1`.\n\n### File Tree Interaction\n\nWhen the file tree is open, you can use the following keymaps:\n\n  * `j`/`k` or `\u003cDown\u003e`/`\u003cUp\u003e`: Move the cursor down/up between file nodes.\n  * `l`: Open the file under the cursor in the main window, displaying its diff.\n  * `q`: Close the file tree window.\n  * `R`: Refresh the file tree.\n  * `?`: Show a help dialog.\n\nWhen the file tree opens, the first file is automatically opened in the main window.\n\nThe file tree displays the Git status of each file:\n\n  - `M`: Modified\n  - `A`: Added\n  - `D`: Deleted\n  - `R`: Renamed\n  - `C`: Copied\n  - `?`: Untracked\n\n### Navigating Hunks\n\nTo navigate between hunks, you'll need to set your own keymaps:\n\n```lua\nvim.keymap.set('n', ']h', function() require('unified.navigation').next_hunk() end)\nvim.keymap.set('n', '[h', function() require('unified.navigation').previous_hunk() end)\n```\n\n### Toggle API\n\nFor programmatic control, you can use the toggle function:\n\n```lua\nvim.keymap.set('n', '\u003cleader\u003eud', require('unified').toggle, { desc = 'Toggle unified diff' })\n```\n\nThis toggles the diff view on/off, remembering the previous commit reference.\n\n### Hunk actions (API)\n\nUnified provides a function-only API for hunk actions. Define your own keymaps or commands if desired.\n\nExample keymaps:\n\n```lua\nlocal actions = require('unified.hunk_actions')\nvim.keymap.set('n', 'gs', actions.stage_hunk,   { desc = 'Unified: Stage hunk' })\nvim.keymap.set('n', 'gu', actions.unstage_hunk, { desc = 'Unified: Unstage hunk' })\nvim.keymap.set('n', 'gr', actions.revert_hunk,  { desc = 'Unified: Revert hunk' })\n```\n\nBehavior notes:\n- Operates on the hunk under the cursor inside a regular file buffer (not in the unified file tree buffer).\n- Stage: applies a minimal single-hunk patch to the index.\n- Unstage: reverse-applies the hunk patch from the index.\n- Revert: reverse-applies the hunk patch to the working tree.\n- Binary patches are skipped with a user message.\n- After an action, the inline diff and file tree are refreshed automatically.\n\n## Commands\n\n  * `:Unified`: Toggles the diff view. If closed, it shows the diff against `HEAD`. If open, it closes the view.\n  * `:Unified \u003ccommit_ref\u003e`: Shows the diff against the specified commit reference (e.g., a commit hash, branch name, or tag) and opens the file tree for that range.\n  * `:Unified reset`: Removes all unified diff highlights and signs from the current buffer and closes the file tree window if it is open.\n\n## Development\n\n### Running Tests\n\nTo run all automated tests:\n\n```bash\nmake tests\n```\n\nTo run a specific test function:\n\n```bash\nmake test TEST=test_file_name.test_function_name\n```\n\n## License\n\nMIT\n","funding_links":[],"categories":["Git"],"sub_categories":["Quickfix"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxkirillov%2Funified.nvim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faxkirillov%2Funified.nvim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxkirillov%2Funified.nvim/lists"}