74

Is there a way in VS Code to synchronise vertical or horizontal scrolling in splitted view ?

Like in Notepad++ for instance :

From buttons:

Notepad++ Vertical/Horizontal sync

From View menu:

Notepad++ Vertical/Horizontal sync

Michaël Polla
  • 3,511
  • 3
  • 23
  • 37
  • 5
    Looks like it is a feature request, see https://github.com/Microsoft/vscode/issues/18137 but not with a lot of momentum other than for markdown previews. – Mark Jul 26 '17 at 14:39
  • Related (duplicate?): [VS Code: How to scroll split panels simultaneously](/q/59187587) – starball Feb 20 '23 at 22:33

2 Answers2

87

2021 EDIT: While the below does still work, as per @Mr.D.Q's answer below, there does now exist a plugin Sync Scroll to accomplish this task.

--

From what I can find, the closest thing you can do is use the "Compare Files" feature.

In the File-Explorer sidebar:

  • Right-click on File A -> Select For Compare
  • Right-click on File B -> Compare With Selected
Jeremy Moritz
  • 13,864
  • 7
  • 39
  • 43
Rich Werden
  • 1,190
  • 11
  • 11
  • That's a nice workaround ! I'll mark your answer as accepted, until maybe one day VSCode offers a true way to synchronise vertical and horizontal scrolling. – Michaël Polla Aug 24 '18 at 18:06
  • 15
    This only works for the scenario when you want to compare very similar files. A lot of other times this feature does not work well. – Chang Jan 21 '19 at 20:50
  • 4
    I just want to emphasize the SIDEBAR EXPLORER and not the top file navigation bar. – Gwi7d31 Mar 11 '21 at 17:16
  • 2
    The first answer's the best. With Sync Scroll, if A file contains more lines than B file, then there is a gap between them. The native 'Select for Compare' + 'Compare with Selected' is more accurate :) – benCat Sep 15 '22 at 09:45
35

If you want to more advanced synchronized scrolling feature, please check out this vscode extension Sync Scroll

Mr.D.Q
  • 524
  • 4
  • 4