Skip to content
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

git add -p support - Go to the next file when at the last hunk in a file #882

Closed
ColinKennedy opened this issue Sep 23, 2023 · 2 comments
Closed
Labels
enhancement New feature or request

Comments

@ColinKennedy
Copy link

Is your feature request related to a problem? Please describe.
I'd like to use gitsigns.nvim as a sort of interactive replacement for git add -p. When the hunks of one file end, git add -p will start inspecting the hunks of the next file. So far I haven't found a way to replicate that easily with gitsigns.nvim

Describe the solution you'd like
A next/prev hunk command or something similar that will advance to the next file, rather than wrap to the start of the file or stop advancing.

Describe alternatives you've considered
Writing a custom function that is essentially ...

if not at_last_hunk:
    next_hunk()
    return

file = get_next_unstaged_file_in_the_git_repository()

if not file:
    stop
    return

:e file

"if at the end of the hunks in this file, look up what the next unstaged git file path may be and switch the window to there" function.

@ColinKennedy ColinKennedy added the enhancement New feature or request label Sep 23, 2023
@lewis6991
Copy link
Owner

You can try :Gitsigns setqflist all but other than that this is out of scope.

@lewis6991 lewis6991 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 23, 2023
@dudicoco
Copy link

dudicoco commented Apr 7, 2024

@lewis6991 is there a way to automatically run :Gitsigns preview_hunk_inline when entering an item in the qflist?

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

No branches or pull requests

3 participants