How do I open a new file using ctrl+p, so it doesn't override the current file, but rather use a new tab?
Also, would it be possible to focus the searched file instead of opening it, if it was already opened on a tab, to avoid duplicates?
How do I open a new file using ctrl+p, so it doesn't override the current file, but rather use a new tab?
Also, would it be possible to focus the searched file instead of opening it, if it was already opened on a tab, to avoid duplicates?
When a single click to a file is made in the sidebar, Visual Studio Code opens it in Preview Mode, which allows you to quickly view files.
Important!
If you want to edit a file, don't open in Preview Mode, double-click on the file in the sidebar instead.
If the file is already open in Preview mode, then to convert it to edit mode:
Criteria:
If you want to disable Preview Mode all together, that is:
Solution:
Preferences: Open User Settings
, this will open the Settings editor. Search for workbench.editor.enablePreview
, and uncheck the checkbox. (changes are autosaved and indicated with a blue left border)Additional:
workbench.editor.enablePreviewFromQuickOpen
.TL;DR for Mac users
Step 1: Press ⌘+,
Step 2: Search for Preview
and disable Workbench › Editor: Enable Preview
for both to keep a file tab open when you first click and after use go to definition,
"workbench.editor.enablePreview": false
is the right answer.
One more simpler option instead of changing setting is drag the file from sidebar on to the tabs bar it opens in new tab.