Reputation: 4011
Is there a way in VS Code
to synchronise vertical or horizontal scrolling in splitted view ?
Like in Notepad++
for instance :
From buttons:
From View menu:
Upvotes: 105
Views: 79531
Reputation: 1687
2024 EDIT: There is now an official editor-action named "View: Toggle Locked Scrolling Across Editors".
To engage it, open the Command Palette (⌘⇧P(Mac)/^⇧P(Win/Linux)) and type in the action name. Select it and hit enter.
See this official Youtube Short for a demo.
--
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:
Upvotes: 136
Reputation: 34
I tried the Sync Scroll extension, but the scroll is not quite accurate. Instead, I found a better built-in approach. You can:
Right click one of the files you wanna compare > Select for compare
Right click on the other file you wanna compare > Compare with selected
And walá! You'll have your files side by side and sync scroll works as a charm ;)
Upvotes: 1
Reputation: 51423
See issue ticket Synchronized Scrolling in Split Editor #33110. See the VS Code 1.88 release notes.
You can use the View: Toggle Locked Scrolling Across Editors
command. Quoting one of the maintainers (Benjamin) in their comment:
[the command] will synchronize the scrolling across all text editors and notebooks. You can also set a keybinding for workbench.action.holdLockedScrolling which will synchronize the scrolling only when being pressed.
You can also bind a keyboard shortcut to the command ID workbench.action.holdLockedScrolling
, which will synchronize scrolling only while that keyboard shortcut is being pressed.
Note that you can also use the "select for compare" feature to get a similar effect (see Visual Studio Code - is there a Compare feature like that plugin for Notepad ++?).
Upvotes: 20
Reputation: 562
If you want to more advanced synchronized scrolling feature, please check out this vscode extension Sync Scroll
Upvotes: 38