fix(conflict)!: change default nav keymaps from ]x/[x to ]c/[c (#132)

## Problem

The default conflict navigation keymaps `]x`/`[x` are non-standard. Vim
natively uses `]c`/`[c` for diff navigation, so the same keys are far
more
intuitive for conflict jumping.

## Solution

Change the defaults for `conflict.keymaps.next` and
`conflict.keymaps.prev`
to `]c` and `[c`. This is a breaking change for users relying on the
previous
defaults without explicit configuration.
This commit is contained in:
Barrett Ruth 2026-02-24 12:07:54 -05:00 committed by GitHub
parent bfd3a40c5f
commit 700a9a21ad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 16 additions and 16 deletions

View file

@ -95,8 +95,8 @@ Configuration is done via `vim.g.diffs`. Set this before the plugin loads:
theirs = 'dot', theirs = 'dot',
both = 'dob', both = 'dob',
none = 'don', none = 'don',
next = ']x', next = ']c',
prev = '[x', prev = '[c',
}, },
}, },
} }
@ -368,8 +368,8 @@ Example configuration: >lua
vim.keymap.set('n', 'ct', '<Plug>(diffs-conflict-theirs)') vim.keymap.set('n', 'ct', '<Plug>(diffs-conflict-theirs)')
vim.keymap.set('n', 'cb', '<Plug>(diffs-conflict-both)') vim.keymap.set('n', 'cb', '<Plug>(diffs-conflict-both)')
vim.keymap.set('n', 'cn', '<Plug>(diffs-conflict-none)') vim.keymap.set('n', 'cn', '<Plug>(diffs-conflict-none)')
vim.keymap.set('n', ']x', '<Plug>(diffs-conflict-next)') vim.keymap.set('n', ']c', '<Plug>(diffs-conflict-next)')
vim.keymap.set('n', '[x', '<Plug>(diffs-conflict-prev)') vim.keymap.set('n', '[c', '<Plug>(diffs-conflict-prev)')
< <
*<Plug>(diffs-merge-ours)* *<Plug>(diffs-merge-ours)*
@ -483,8 +483,8 @@ Configuration: ~
theirs = 'dot', theirs = 'dot',
both = 'dob', both = 'dob',
none = 'don', none = 'don',
next = ']x', next = ']c',
prev = '[x', prev = '[c',
}, },
}, },
} }
@ -555,10 +555,10 @@ Configuration: ~
{none} (string|false, default: 'don') {none} (string|false, default: 'don')
Reject both changes (delete entire block). Reject both changes (delete entire block).
{next} (string|false, default: ']x') {next} (string|false, default: ']c')
Jump to next conflict marker. Wraps around. Jump to next conflict marker. Wraps around.
{prev} (string|false, default: '[x') {prev} (string|false, default: '[c')
Jump to previous conflict marker. Wraps Jump to previous conflict marker. Wraps
around. around.
@ -582,7 +582,7 @@ When pressing `du`/`dU` on an unmerged (`U`) file in the fugitive status
buffer, diffs.nvim opens a unified diff of ours (`git show :2:path`) vs buffer, diffs.nvim opens a unified diff of ours (`git show :2:path`) vs
theirs (`git show :3:path`) with full treesitter and intra-line highlighting. theirs (`git show :3:path`) with full treesitter and intra-line highlighting.
The same conflict resolution keymaps (`doo`/`dot`/`dob`/`don`/`]x`/`[x`) The same conflict resolution keymaps (`doo`/`dot`/`dob`/`don`/`]c`/`[c`)
are available on the diff buffer. They resolve conflicts in the working are available on the diff buffer. They resolve conflicts in the working
file by matching diff hunks to conflict markers: file by matching diff hunks to conflict markers:
@ -590,7 +590,7 @@ file by matching diff hunks to conflict markers:
- `dot` replaces the conflict region with theirs content - `dot` replaces the conflict region with theirs content
- `dob` replaces with both (ours then theirs) - `dob` replaces with both (ours then theirs)
- `don` removes the conflict region entirely - `don` removes the conflict region entirely
- `]x`/`[x` navigate between unresolved conflict hunks - `]c`/`[c` navigate between unresolved conflict hunks
Resolved hunks are marked with `(resolved)` virtual text. Hunks that Resolved hunks are marked with `(resolved)` virtual text. Hunks that
correspond to auto-merged content (no conflict markers) show an correspond to auto-merged content (no conflict markers) show an

View file

@ -152,8 +152,8 @@ local default_config = {
theirs = 'dot', theirs = 'dot',
both = 'dob', both = 'dob',
none = 'don', none = 'don',
next = ']x', next = ']c',
prev = '[x', prev = '[c',
}, },
}, },
} }

View file

@ -12,8 +12,8 @@ local function default_config(overrides)
theirs = 'dot', theirs = 'dot',
both = 'dob', both = 'dob',
none = 'don', none = 'don',
next = ']x', next = ']c',
prev = '[x', prev = '[c',
}, },
} }
if overrides then if overrides then

View file

@ -12,8 +12,8 @@ local function default_config(overrides)
theirs = 'dot', theirs = 'dot',
both = 'dob', both = 'dob',
none = 'don', none = 'don',
next = ']x', next = ']c',
prev = '[x', prev = '[c',
}, },
} }
if overrides then if overrides then