Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dlvhdr/diffnav
A git diff pager based on delta but with a file tree, à la GitHub.
https://github.com/dlvhdr/diffnav
cli delta diff git github golang tui
Last synced: 5 days ago
JSON representation
A git diff pager based on delta but with a file tree, à la GitHub.
- Host: GitHub
- URL: https://github.com/dlvhdr/diffnav
- Owner: dlvhdr
- License: mit
- Created: 2024-09-18T14:41:16.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-12-01T11:59:30.000Z (22 days ago)
- Last Synced: 2024-12-17T06:39:44.294Z (6 days ago)
- Topics: cli, delta, diff, git, github, golang, tui
- Language: Go
- Homepage:
- Size: 538 KB
- Stars: 279
- Watchers: 5
- Forks: 4
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# diffnav
A git diff pager based on [delta](https://github.com/dandavison/delta) but with a file tree, à la GitHub.
> [!CAUTION]
> This is early in development, bugs are to be expected.
>
> Feel free to open issues.Demo
## Installation
Homebrew:
```sh
brew install dlvhdr/formulae/diffnav
```Go:
```sh
go install github.com/dlvhdr/diffnav@latest
```> [!NOTE]
> To get the icons to render properly you should download and install a Nerd font from https://www.nerdfonts.com/. Then, select that font as your font for the terminal.
>
> _You can install these with brew as well: `brew install --cask font--nerd-font`_## Usage
### Pipe into diffnav
- `git diff | diffnav`
- `gh pr diff https://github.com/dlvhdr/gh-dash/pull/447 | diffnav`### Set up as global git diff pager
```bash
git config --global pager.diff diffnav
```## Configuration
- Currently you can configure `diffnav` only through delta so [check out their docs](https://dandavison.github.io/delta/configuration.html).
- If you want the exact configuration I'm using - [it can be found here](https://github.com/dlvhdr/diffnav/blob/main/cfg/delta.conf).## Keys
| Key | Description |
| :---------------- | :------------------- |
| j | Next file |
| k | Previous file |
| Ctrl-d | Scroll the diff down |
| Ctrl-u | Scroll the diff up |
| e | Toggle the file tree |
| t | Search/go-to file |
| q | Quit |## Under the hood
`diffnav` uses:
- [Bubble Tea](https://github.com/charmbracelet/bubbletea) for the TUI
- [`delta`](https://github.com/dandavison/delta) for viewing the diffed fileScreenshots use:
- [kitty](https://sw.kovidgoyal.net/kitty/) for the terminal
- [tokyonight](https://github.com/folke/tokyonight.nvim) for the color scheme
- [CommitMono](https://www.nerdfonts.com/font-downloads) for the font