Skip to content

doc, config for nvim.difftool (built-in to neovim) as a diff-editor merge-tool - #10207

Open
DirectXMan12 wants to merge 1 commit into
jj-vcs:mainfrom
DirectXMan12:config/nvim-difftool
Open

DirectXMan12 wants to merge 1 commit into
jj-vcs:mainfrom
DirectXMan12:config/nvim-difftool

Conversation

@DirectXMan12

@DirectXMan12 DirectXMan12 commented Sep 16, 2026

Copy link
Copy Markdown

this notes/adds built-in config for the new(ish) builtin neovim support for dirdiffs, which makes neovim a relatively nice jj merge tool (nicer than vimdiff, easier to set up than the mentioned plugins since it ships in neovim ootb).

i've added 2 commits here -- a minimal "here's a link to the wiki" and a more maximal "here's an entry in the built-in config + a note in the docs". wasn't sure which was more preferable.

Checklist

If applicable:

  • I have updated CHANGELOG.md
  • I have updated the documentation (README.md, docs/, demos/)
  • I have updated the config schema (cli/src/config-schema.json) (n/a)
  • I have added/updated tests to cover my changes (n/a)
  • I fully understand the code that I am submitting (what it does,
    how it works, how it's organized), including any code drafted by an LLM.
  • For any prose generated by an LLM, I have proof-read and copy-edited with
    an eye towards deleting anything that is irrelevant, clarifying anything
    that is confusing, and adding details that are relevant. This includes,
    for example, commit descriptions, PR descriptions, and code comments.
    (n/a, this comes 100% from wetware ;-))

@google-cla

google-cla Bot commented Sep 16, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@DirectXMan12
DirectXMan12 requested a review from a team as a code owner September 16, 2026 16:26

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The following commits do not follow our format for subject lines:

  • 19a75da: [docs] nvim 0.12.0 nvim.difftool instructions are in the wiki
  • 0f7d0d0: ship a config for nvim 0.12.0's difftool as a merge-tool

Commits should have a subject line following the format <topic>: <description>. Please review the commit guidelines for more information.

@DirectXMan12 DirectXMan12 changed the title Config/nvim difftool doc, config for nvim.difftool (built-in to neovim) as a merge-tool Sep 16, 2026
@github-actions
github-actions Bot dismissed their stale review September 16, 2026 16:32

All commits are now correctly formatted. Thank you for your contribution!

@josephlou5 josephlou5 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix tests. Looks like test_completion::test_merge_tools is failing.

Comment thread docs/config.md Outdated
@DirectXMan12 DirectXMan12 changed the title doc, config for nvim.difftool (built-in to neovim) as a merge-tool doc, config for nvim.difftool (built-in to neovim) as a diff-editor merge-tool Sep 17, 2026
@DirectXMan12

DirectXMan12 commented Sep 17, 2026

Copy link
Copy Markdown
Author

ok, tests fixed, reworded description slightly to clarify that this is a diff-edit merge-tool, and not a 3-way-diff merge-tool 1.

in theory we could add a unified "neovim" or "nvim" entry that was nvim.difftool for edit, and vimdiff for merge. i can do that if you want, but it's not currently how i use stuff in my config, so i didn't think to initially do it.

Footnotes

  1. i must've been a bit tired yesterday when i finally submitted this patch -- i swear i've read that config.md section like 30 times but every time i glazed over the fact that that list was just 3-way merge-tools, and not also diff tools. sorry bout that

@DirectXMan12

DirectXMan12 commented Sep 17, 2026

Copy link
Copy Markdown
Author

in theory we could add a unified "neovim" or "nvim" entry that was nvim.difftool for edit, and vimdiff for merge. i can do that if you want, but it's not currently how i use stuff in my config, so i didn't think to initially do it.

actually, now that i think about this more, i think this probably feels like a nicer experience for users. just being able to do --tool nvim seems nicer than needing to remember vimdiff vs nvim-difftool.

lemme test that real quick and i'll push the changes

@DirectXMan12

Copy link
Copy Markdown
Author

ok, ci looks green on those new changes, should be good for another review round

diff-args=["--diff", "$left", "$right", "--wait"]
diff-invocation-mode="file-by-file"
edit-args = []

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'd personally prefer a commit that adds the tool directly instead of just in the documentation (so your second commit), but I'm not a maintainer so just providing my opinion (no changes needed).

(I also don't use Neovim, so this is just from the perspective of "if we can make it easier for users, might as well make it easier for users" ¯\⎽(ツ)⎽/¯)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Also, I won't give approval (but again, not a maintainer) because for now there are 2 commits doing different things, so this PR can't be merged as-is.)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool, I'm happy to drop the first commit if others feel the same way, figured I'd just offer the option

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I personally prefer the second commit too, so seems good to me, but I'll wait for a maintainer to weight in)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I think all of this can be a single commit.

nvim 0.12.0 adds support for using its built-in plugin `nvim.difftool`
to do dirdiffs.  this works quite nicely with jj, so add a built-in
config for it and document that in the docs so that folks can see it.

this removes the link to the wiki (introduced in the previous commit)
since the config is now built-in.
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

Successfully merging this pull request may close these issues.

3 participants