Skip to content

Side by Side diffs #155

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
hipstersmoothie opened this issue Aug 15, 2018 · 8 comments
Closed

Side by Side diffs #155

hipstersmoothie opened this issue Aug 15, 2018 · 8 comments

Comments

@hipstersmoothie
Copy link

Is your feature request related to a problem? Please describe.

I'm way better at reading side by side diffs

Describe the solution you'd like

LazyGit can be configured to show side by side diffs

@jesseduffield
Copy link
Owner

see #161

@jesseduffield
Copy link
Owner

This has now been implemented. See https://github.com/jesseduffield/lazygit/blob/master/docs/Custom_Pagers.md

If anybody would like to see changes to the feature, let me know :) closing

@haydenflinner
Copy link

haydenflinner commented Aug 7, 2023

Is there a minimal example of how to get side by side diffs from this custom pager support? from the pictures it looks like ydiff will do the trick, is that the best option?

Edit found this from reddit:

cargo install git-delta
# Put this in ~/.config/lazygit/config.yml
git: 
    paging:
        colorArg: always
        pager: delta --dark --paging=never --syntax-theme base16-256 -s

@iklobato
Copy link

iklobato commented Jul 31, 2024

For those who are new at lazygit, here is the step by step to make it show git diff side by side

  1. Install git delta
$ brew install git-delta
  1. Open the configuration file
Linux: ~/.config/lazygit/config.yml
MacOS: ~/Library/Application\ Support/lazygit/config.yml
Windows: %LOCALAPPDATA%\lazygit\config.yml (default location, but it will also be found in %APPDATA%\lazygit\config.yml

or

Linux: ~/.config/jesseduffield/lazygit/config.yml
MacOS: ~/Library/Application\ Support/jesseduffield/lazygit/config.yml
Windows: %APPDATA%\jesseduffield\lazygit\config.yml
  1. Add the snipper from @haydenflinner
git: 
    paging:
        colorArg: always
        pager: delta --dark --paging=never --syntax-theme base16-256 -s
  1. Close and reopen lazygit

@dhupee
Copy link

dhupee commented Feb 26, 2025

For those who used NixOS, you can use example from my dotfiles https://github.com/dhupee/dotfiles/blob/master/private_dot_nix-configs/modules/home-manager/git.nix

I reference @ iklobato comment and applied that in NixOS, great job

@hk0i
Copy link

hk0i commented Apr 13, 2025

@iklobato what about when we go into a single file to stage changes? mine doesn't appear to be using the custom pager for that.
I mainly want the syntax highlighting from delta:

Image

@hk0i
Copy link

hk0i commented Apr 13, 2025

never mind looks like that's not possible, according to #1335 (reply in thread)

@stefanhaller
Copy link
Collaborator

@hk0i Some work on this has been started in #4332, but it is nowhere near finished.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants