- Open VS Code.
- Click on File.
- Then find Preferences -> settings.
- Click on the Text Editor in the left side menu.
- Locate the Scroll Predominant Axis Setting.
- Check or uncheck: Scroll only along the predominant axis when scrolling both vertically and horizontally at the same time. Prevents horizontal drift when scrolling vertically on a trackpad.