4

is there a way to number the lines that are different in vimdiff? Is there a way to count the lines that are different in vimdiff?

cokedude
  • 141
  • 2

1 Answers1

1

You can see which lines are different in diff mode:

echo filter(range(1, line('$')), 'diff_hlID(v:val, 1) == hlID("DiffChange") || diff_hlID(v:val, 1) == hlID("DiffText")')
Rick Howe
  • 353
  • 1
  • 7
  • How do I use this? When I put this on the command line this is what I see :>echo filter(range(1, line('$')), 'diff_hlID(v:val, 1) == hlID("DiffChange") || diff_hlID(v:val, 1) == hlID("DiffText")') bash: syntax error near unexpected token(' `. – cokedude Mar 10 '21 at 16:41
  • When I put this in vim this is what I see E117: Unknown function: range E116: Invalid arguments for function filter(range(1, line('$')), 'diff_hlID(v:va l, 1) == hlID("DiffChange") || diff_hlID(v:val, 1) == hlID("DiffText")') E15: Invalid expression: filter(range(1, line('$')), 'diff_hlID(v:val, 1) == hlI D("DiffChange") || diff_hlID(v:val, 1) == hlID("DiffText")') Hit ENTER or type command to continue. – cokedude Mar 10 '21 at 16:41
  • @cokedude it works for me, maybe your vim version is too old? – Biggybi Apr 04 '22 at 07:35