Is it possible to diff
or even vimdiff
two very similar subroutines occurring in the same file? If so, how?
I can think of copying the two subroutines in two separate files and then diff
them, but is there a way to do it within the original file?
Plugin linediff.vim : Perform an interactive diff on two blocks of text is similar to the one pointed ou by Vincent with some additional features:
To use it you perform a visual selection on the first block to diff, enter command :Linediff
, and repeat it to the second block. To quit, :LineDiffReset
I've found the followings maps helpful:
noremap \ldt :Linediff<CR>
noremap \ldo :LinediffReset<CR>