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.ctrl+p and then open it fully for editing using ctrl+k enter. This turns the preview tab into a fully independent tab as you'd get if you opened the file by double-clicking it in the explorer.Instead of changing a setting, a simpler option is to drag the file from the sidebar on to the tabs bar. It opens in a new tab.
Go to menu File → Preferences → Settings → search for "settings.json", and at the last line before }, add a comma to the last option and paste:
"workbench.editor.enablePreview": false
For example:
{ "editor.fontFamily": "'Consolas', 'monospace', 'Times New Roman'", "terminal.integrated.fontFamily": "monospace", "editor.fontSize": 13, "workbench.iconTheme": "vscode-icons", "workbench.editor.enablePreview": false } In the quick open menu, a file can be opened in the background by pressing the right arrow key. The current tab, with the quick open menu remains in the foreground, and the same process can be repeated to open multiple files.
VSCode doc can be found here.