how can I diff two sections of the same file?

前端 未结 7 1556
心在旅途
心在旅途 2021-02-13 16:53

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

7条回答
  •  萌比男神i
    2021-02-13 17:13

    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

提交回复
热议问题