I have a source file with two similar yet subtly different sections. I\'d like to merge the two sections into one subroutine with a parameter that handles the subtle difference
The linediff plugin for Vim works well for me. Visually select one section of your file and type :Linediff
. Visually select the other section and type :Linediff
. It will put vim in to vimdiff mode, showing only the two sections you highlighted previously. Type:LinediffReset
to exit vimdiff mode.
More info:
https://unix.stackexchange.com/a/52759/32477
https://superuser.com/a/414958/199800