Repository navigation
Resolve merge conflicts in a three-pane merge window - #12
Merged
Merged
Conversation
A pull or branch merge that stops on conflicts now opens the local changes on the Unmerged changelist instead of only printing git's output. Enter on a conflicting file opens yours | result | theirs in a new tab, like IntelliJ IDEA's Merge dialog: conflicts line up and are colored by state, every choice applies to the conflict under the cursor and can be changed or undone, and the file is written and added only once all are resolved. After the last file it offers to commit the merge or continue the rebase, cherry-pick or revert; A aborts it. All unmerged statuses (AA, DU, UD, ...) are listed as conflicts now, not only UU, and a file deleted on one side asks to keep or delete it. Claude-Session: https://claude.ai/code/session_01BwofrMkZ4QpGsCYYSgncrd
It makes a repository stopped on conflicts in a merge, a rebase or with a deleted file, then prints how to open it and the keys to use. Claude-Session: https://claude.ai/code/session_01BwofrMkZ4QpGsCYYSgncrd
The help colored the first word of each label too, since labels follow the keys after spaces. Keys are highlighted by position now. The result pane's status line cut its start when narrow; the file name is cut first. Claude-Session: https://claude.ai/code/session_01BwofrMkZ4QpGsCYYSgncrd
Saving an edited conflict wiped its buffer during the write, so the q of :wq or :x then closed the result pane below it. The edit window now closes once the write is done, and any way of closing it, :q! too, goes back to the result. Claude-Session: https://claude.ai/code/session_01BwofrMkZ4QpGsCYYSgncrd
Like the commit message, where closing commits, q accepts the result. It is refused while conflicts are unresolved. Q discards the choices. Claude-Session: https://claude.ai/code/session_01BwofrMkZ4QpGsCYYSgncrd
New remote branches only showed up after a git fetch in a terminal. The list now runs git fetch --all --prune as a job when it opens and shows the branches again once it is done. git_branch_fetch turns it off. Claude-Session: https://claude.ai/code/session_01BwofrMkZ4QpGsCYYSgncrd
w next to q read as two ways to do different things. q accepts, like closing the commit message commits; Q discards. Claude-Session: https://claude.ai/code/session_01BwofrMkZ4QpGsCYYSgncrd
The status line and messages said q and w even when git_merge_mappings set other keys. Claude-Session: https://claude.ai/code/session_01BwofrMkZ4QpGsCYYSgncrd
ubuntu-latest moved to 26.04, which the neovim PPA does not build for, so adding it failed the job before any test ran. Claude-Session: https://claude.ai/code/session_01BwofrMkZ4QpGsCYYSgncrd
Each fetch redrew the list even when nothing changed, flashing it and the cursor, plus a redraw that cleared the input line. Now the refs are compared first, and a failed reload keeps the list as it was instead of leaving it empty. Claude-Session: https://claude.ai/code/session_01BwofrMkZ4QpGsCYYSgncrd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
You can now resolve merge conflicts in Vim, so you no longer have to go back to a terminal. The window is modeled on IntelliJ IDEA's Merge dialog.
<C-o>in:ProjectGitBranch) stops on conflicts, the local changes open on the Unmerged changelist. Before, you only got git's output. Opening a conflicting file (Enter by default) shows yours | result | theirs in a new tab.autoload/project/git_merge.vim):<yours,>theirs,=both,eedit by hand,uundo,]c/[cmove,L/Rtake one side for every conflict.qwrites the file and runsgit add. It is refused while conflicts are unresolved.Qdiscards your choices.2/5 3 unresolved). Both use the keys fromgit_merge_mappings.Ain the local changes aborts it.AA,DU,UD, ...) are listed as conflicts, not onlyUU. A file deleted on one side asks whether to keep it or delete it.git fetch --all --prunein the background when it opens, and refreshes only when a branch moved.git_branch_fetchturns this off.Basic-Testinstalls Neovim from its release. The neovim PPA has no build for Ubuntu 26.04, whichubuntu-latestnow uses, so the job was failing before any test ran.test/demo_merge.sh [merge|rebase|delete]creates a repository stopped on conflicts so you can try the window by hand.Testing
test/cases/git_merge_test.vimcases cover::wq,:xand:q!;test/cases/git_branch_test.vim: a branch pushed from another clone shows up after the background fetch.dev-mergeis green.https://claude.ai/code/session_01BwofrMkZ4QpGsCYYSgncrd
Generated by Claude Code