This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

Lua 98.9%
Shell 1.1%
45 1 0

Clone this repository

https://git.vm.fail/algmyr.se/vcmarkers.nvim https://git.vm.fail/did:plc:64qihlmazyf7bnlbtqfz3orp
ssh://git@knot.algmyr.se:2222/algmyr.se/vcmarkers.nvim ssh://git@knot.algmyr.se:2222/did:plc:64qihlmazyf7bnlbtqfz3orp

For self-hosted knots, clone URLs may differ based on your setup.


README.md

VCMarkers.nvim#

Plugin that handles diff markers. Supports jj style diffs and diff3.

image

When started, the processing of diff markers will continue to auto-update until there are no more diff markers in the file. By default the plugin tries to start tracking on buffer load, but if needed tracking can also be manually controlled using

VCMarkers start
VCMarkers stop

Features#

For all diff styles

  • Diff marker highlighting.
  • Navigation between markers.
    • VCMarkers next_marker
    • VCMarkers prev_marker
  • Fold everything except markers + context.
    • VCMarkers fold
  • "Select" the current section and replace the marker with it.
    • VCMarkers select

For jj style diffs

  • Cycle through diff representations.
    • VCMarkers cycle
  • Handling of jj 0.37 \\\\\\\ section header continuation.
    • Handled for both basic highlighting and cycling.

E.g. snapshot first

<<<<<<< Conflict 1 of 1
+++++++ Contents of side #1
HELLO
%%%%%%% Changes from base to side #2
-hello
+hi
>>>>>>> Conflict 1 of 1 ends

into snapshot second

<<<<<<< Conflict 1 of 1
%%%%%%% Changes from base to side #1
-hello
+HELLO
+++++++ Contents of side #2
hi
>>>>>>> Conflict 1 of 1 ends

into snapshot all

<<<<<<< Conflict 1 of 1
+++++++ Contents of side #1
HELLO
------- Contents of base
hello
+++++++ Contents of side #2
hi
>>>>>>> Conflict 1 of 1 ends

and then back to snapshot first.

Cycling and selecting in action#

Screen recording

Not yet implemented#

  • Documentation.

Example config#

For the documented default config, have a look inside init.lua.

Lazy#

Example configuration

{
  'algmyr/vcmarkers.nvim',
  config = function()
    require('vcmarkers').setup {}

    dependencies = {
      "algmyr/vclib.nvim",
    },

    local function map(mode, lhs, rhs, desc, opts)
      local options = { noremap = true, silent = true, desc = desc }
      if opts then options = vim.tbl_extend('force', options, opts) end
      vim.keymap.set(mode, lhs, rhs, options)
    end

    map('n', '<space>m]', function() require('vcmarkers').actions.next_marker(0, vim.v.count1) end, 'Go to next marker')
    map('n', '<space>m[', function() require('vcmarkers').actions.prev_marker(0, vim.v.count1) end, 'Go to previous marker')
    map('n', '<space>ms', function() require('vcmarkers').actions.select_section_verbatim(0) end, 'Replace marker with section contents')
    map('n', '<space>mS', function() require('vcmarkers').actions.select_all_plus(0) end, 'Replace marker with plus parts of marker')
    map('n', '<space>mf', function() require('vcmarkers').fold.toggle(0) end, 'Fold outside markers')
    map('n', '<space>mc', function() require('vcmarkers').actions.cycle_marker(0) end, 'Cycle marker representations')
  end,
}

As per https://lazy.folke.io/packages dependencies are specified in lazy.lua.