Stop Visual Studio Code From Closing the Current File When Clicking a New File to Open It.
The Visual Studio Code Editor’s default behavior of opening files in “preview mode” when clicking the file name in explorer can be frustrating in certain circumstances. I learned how to shut that behavior off today, so thought I would share it here.
Click File > Preferences > Settings
Search for “preview mode” in the Settings search bar:

Search Settings for Preview Mode
- Uncheck the box under “Workbench > Editor: Enable Preview”

Uncheck This Checkbox to Shut Off Preview Mode
- Visual Studio Code will show a vertical line next to the setting to indicate it has been changed.

Uncheck This Checkbox to Shut Off Preview Mode
Close the Settings window
The setting change will be automatically applied when the window is closed.
Once these instructions have been completed, Visual Studio Code will leave any file you click on open in the Editor window.