A terminal-based diff viewer written in Rust that makes it easier to compare files. The tool not only shows you nicely formatted diffs, it allows you to copy the patch content to the clipboard or export it as a file.
You can install lazydiff using Cargo:
cargo install lazydiff- Rust 1.70 or higher
- A terminal emulator with support for modern terminal features
If you prefer to build from source:
git clone https://github.com/yourusername/lazydiff.git
cd lazydiff
cargo build --releaseThe binary will be available at target/release/lazydiff.
Launch lazydiff with two files to compare:
lazydiff file1.txt file2.txtOr start lazydiff and interactively select files:
lazydiffYou can also specify just the source file:
lazydiff source.txtIn Diff View:
q- Quit the applications- Select a new source filet- Select a new target filec- Copy diff to clipboarde- Export diff as a patch file↑/↓- Scroll through the diff
In File Browser:
↑/↓- Navigate files and directoriesEnter- Select file or enter directoryEscorq- Cancel selection (or exit if no files selected)
- Interactive File Browser: Navigate your filesystem and select files to compare
- Syntax Highlighting: Color-coded diff output (green for additions, red for deletions)
- Clipboard Integration: Copy diffs directly to your clipboard with a single keypress
- Patch Export: Generate standard unified diff patch files
- Intuitive Interface: Clean, distraction-free TUI built with ratatui
For information on contributing to lazydiff, please see the Contributing Guide.
This project is licensed under the MIT License - see the LICENSE file for details.