This behaviour is controlled by the following setting:
"explorer.autoReveal": false
There is currently no setting for keeping the selected file in the explorer, but this one at least keeps the scroll position fixed and prevents the "jumping".
Update
In current versions, the same setting now keeps the selected file.
After you apply "explorer.autoReveal": false
, as mentioned above, you can also set up
{ "key": "cmd+e", "command": "workbench.files.action.showActiveFileInExplorer" }
As commented in issue 23902 (Option to keep file selected in sidebar without forcing a scroll)
autoReveal
to true, the jumping inside file explorer is confusing;autoReveal
to false, I have to use showActiveFileInExplorer
keybinding or right click menu every time when switch between tabsBut with VSCode 1.46 (May 2020) you now have:
Explorer auto reveal focus without forcing a scroll
There is a new option
focusNoScroll
for theexplorer.autoReveal
setting.When using this option, the Explorer will automatically select files when opening them but will not scroll to reveal them in the Explorer view.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With