30

When I open up the Command Palette (Ctrl or Cmd + P), type in a filename and hit Enter, the file will automatically be opened in Preview mode.

Open File Permanently

What I want is to have an option to open a file permanently from the Command Palette. I am aware of the "workbench.editor.enablePreviewFromQuickOpen" settings, but that will disable Preview mode.

For example, selecting a file in the Command Palette and hitting Ctrl + Enter will open the file as Preview in a new Split view. I am looking for a similar shortcut to open a file permanently.

Edit 1

Correction: I meant the Quick Look mode using Cmd + P / Ctrl + P. The Command Palette is used to run commands, and cannot search or open files.

Hanxue
  • 12,243
  • 18
  • 88
  • 130
  • Duplicate of https://stackoverflow.com/questions/45945820/vs-code-keyboard-shortcut-to-take-file-out-of-preview-mode/47840585?noredirect=1#comment82645498_47840585 – Mark Dec 15 '17 at 22:30
  • @Mark Which may in turn be a dupe of [this question](https://stackoverflow.com/questions/38713405/how-to-config-vscode-to-open-files-always-in-a-new-tab/38723094#38723094]). – ruffin Jul 09 '18 at 18:11
  • This is not duplicate, because in the mentioned question, they ask to get the file out of preview mode. OP here asks to open it permanently, which are two different things. – Florian Leitgeb Dec 18 '18 at 18:01

4 Answers4

30

Just press the Right arrow when your file is highlighted. The Command Palette stays exactly where it is and your file opens (in non-preview) in the background. You can do this as many times as you like.

Boris Verkhovskiy
  • 14,854
  • 11
  • 100
  • 103
GunnerGuyven
  • 541
  • 6
  • 8
26

What I was looking for was: Settings -> Workbench -> Editor Management

I set Enable Preview and unset Enable Preview from Quick Open which makes VSCode behave like st3.

Andrew Burns
  • 13,917
  • 9
  • 40
  • 42
12

With Quick Look open, select the file you wish to open permanently

Quick open

then press Alt + Enter to open the file permanently.

Note: this shortcut only works in Visual Studio Code 1.19 and above

@GunnerGuyven's answer also work - select file in Quick Look then

Hanxue
  • 12,243
  • 18
  • 88
  • 130
0

In Visual Studio 2017: Uncheck all checkboxes of menu Debug > Options, section Environment > Tabs and Windows > Preview Tab

enter image description here

sergiol
  • 4,122
  • 4
  • 47
  • 81
  • @MaximilianoBecerra: Yeah, I know. But I came here searching it for VS, may be it will be useful later to one in the same situation as me. – sergiol Apr 15 '20 at 16:06