Skip to content

Conversation

@trosh
Copy link

@trosh trosh commented Oct 8, 2025

The aim for this is to be used from Jujutsu (https://github.com/jj-csv/jj) as a 3-pane diff editor, for example with the following jj/config.toml:

[ui]
diff-editor  = "vimtabdiff3"
merge-editor = "vimtabdiff3"

[merge-tools.vimtabdiff3]
program = "vimtabdiff.py"
edit-args = [ "$left", "$output", "$right" ]

Using the config above (with $output in the center), getting all cursors in the center pane after loading vimtabdiff.py can be done with:

:tabdo wincmd h

Note, however, that Vim commands for working with more than 2 diffing panes require a “bufspec” and become pretty much unusable with multiple 3-pane diffs at once. For instance, there is no such thing as a relative bufspec, and you therefore cannot :1,$diffget all center panes from their left neighbour pane.

Closes #10

The aim for this is to be used from Jujutsu (https://github.com/jj-csv/jj) as a
3-pane diff editor, for example with the following jj/config.toml:

    [ui]
    diff-editor  = "vimtabdiff3"
    merge-editor = "vimtabdiff3"

    [merge-tools.vimtabdiff3]
    program = "vimtabdiff.py"
    edit-args = [ "$left", "$output", "$right" ]

Using the config above (with $output in the center), getting all cursors in the
center pane after loading vimtabdiff.py can be done with:

    :tabdo wincmd h

Note, however, that Vim commands for working with more than 2 diffing panes
require a “bufspec” and become barely unusable with multiple 3-pane diffs at once.
Some actions can nonetheless be automated, for instance initializing all center
panes based on their left-hand neighbour (combined with the previous motion):

    :tabdo wincmd h | execute "1,$diffget" . (bufnr('%') - 1)

Closes balki#10
@trosh
Copy link
Author

trosh commented Oct 8, 2025

I changed the commit message once I realized that it is actually feasible to run the specific “relative” diffget command I wanted in all tabs in on line.

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.

FR: support three folders diffing

1 participant