sjl / splice.vim

A Vim plugin for managing three-way merges.
MIT License
235 stars 21 forks source link

Ability to quickly switch both panels in 'compare' mode #32

Open vlmarek opened 7 years ago

vlmarek commented 7 years ago

More often I find myself switching between "one <-> result" and and "original <-> two". I am copying the changes from "Original <-> two" into "one <-> result". The diff between "original <-> result" is not very helpful as it shows too many differences. I thought it would be nice to have simple way of switching the two views.

At the moment I am using these two command lines to achieve that:

:exe 2 . "wincmd w" | call splice#SpliceOriginal() | :exe 3 . "wincmd w" | call splice#SpliceTwo()

and

:exe 2 . "wincmd w" | call splice#SpliceOne() | :exe 3 . "wincmd w" | call splice#SpliceResult()
errael commented 1 month ago

Hi @vlmarek

I've just released Splice9; it's pure vim9script, no python; it's compatible with the original Splice with additional features, particularly UI. I've addressed some issues against the original Splice (see below) and I'm wondering about this issue.

Did you put the workarounds you have into mappings? Wouldn't this be equivalent to having a builtin way to "quickly switch"?

Splice9 has a bind_extra configurable. Considering this issue, I'm wondering having user defined mappings, maybe a bind_user configurable list similar to bind_extra. So you could add something like the following.

    bind_user = [
        '<F1>', ':exe 2 .. "wincmd w" | call splice#SpliceOriginal() | :exe 3 . "wincmd w" | call splice#SpliceTwo()',
        '<F2>', ':exe 2 .. "wincmd w" | call splice#SpliceOne() | :exe 3 . "wincmd w" | call splice#SpliceResult()'
    ]

Feature: #30, #15, https://github.com/errael/splice9/issues/16