How do I stop VSCode from the Side Bar moving to the folder that the current file is in?
The is an option explorer.autoReveal
in settings (either user or workspace) which controls if the explorer should automatically reveal files when opening them.
- Open VS User Settings (Preferences > User Settings). This will open two side-by-side documents.
- Add a new
"explorer.autoReveal": false
setting to the User Settings document on the right if it's not already there. This is so you aren't editing the Default Setting directly, but instead adding to it. - Save the User Settings file.
in Version: 1.42.1
- Open VS User Settings (Preferences > User Settings).
- Search for "explorer auto reveal" without quotes.
- Now uncheck the checkbox.
There is a new setting in v1.46 that will select the files in the explorer but not scroll to reveal them:
We have introduced a new value
focusNoScroll
to theexplorer.autoReveal
setting. For this value Explorer will automatically select files when opening them but will not reveal them.
from v1.46 release notes.
So that setting will highlight the active editor in the explorer but not scroll to it.