Scrolling down both parts of a split-window at the same time in Vim

前端 未结 6 1686
离开以前
离开以前 2020-12-22 18:50

Is it possible to scroll down the left and right parts of a vertically split window in Vim? I have two files I would like to compare roughly. Each line of these files looks

6条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-22 19:28

    From the command line:

    vim -O file1 file2 -c 'windo set scb!'
    

    -O = open side by side.

    -c = what follows in quotes is treated as a vim option.

    'windo' = apply to all panels.

    'scb' = shorthand for scrollbind. Saves some typing, but the two are interchangeable.

    '!' = toggle. This way you can use the same command to turn it off later if you choose to.

提交回复
热议问题