How to disable preview file with single-click in vs code?

Visual Studio-CodeVscode Settings

Visual Studio-Code Problem Overview


I would much rather double-click to open file, and prevent single-click previews. How do we do that in vs code?

Visual Studio-Code Solutions


Solution 1 - Visual Studio-Code

From vscode 1.20:

"workbench.list.openMode": "doubleClick",

Solution 2 - Visual Studio-Code

The only way to disable file previewing when clicked on at all is by setting "workbench.editor.enablePreview" to false.

"workbench.editor.enablePreview": false,

enter image description here

Solution 3 - Visual Studio-Code

Go to File->Preferences->Settings, search for the following and disable it:

"workbench.editor.enablePreview": false

https://i.stack.imgur.com/bInq8.png" alt="Italian Trulli">

Solution 4 - Visual Studio-Code

The necessary settings to prevent single-click in the Explorer view opening a file at all are in the previous answers to this question but you need to apply two of them:

"workbench.editor.enablePreview": false

That will change single-click in the explorer to fully open the file instead of opening it in preview (italics) mode. Arguably this is worse than before unless you're on a touchscreen device so you also need the following setting:

"workbench.list.openMode": "doubleClick"

Now you have to double-click on a file in Explorer to open it and preview is off. Finally, I had to restart all open instances of vscode for the doubleClick change to take effect.

vscode is a moving target so I should point out this was tested in version 1.45.1.

Solution 5 - Visual Studio-Code

As far as I know there is no way to do this right now (version 1.12).

Many people "requested" this feature, just look at this GitHub issue.

.. and a relatively new comment about the issue:

> Sorry, didn't have much time to look into this again. As it stands > right now we need to clean up some debt first in the area of tree > usage throughout our code before we can ask for a PR again.

Solution 6 - Visual Studio-Code

Probably you're mixing the terms. I guess you are talking about "Peek" feature:

vscode peek

And here is how you can disable it:

"editor.gotoLocation.multipleDefinitions": "goto"


Also, there is a "Preview editor" feature:

vscode preview editor

That could be disabled by:

"workbench.editor.enablePreview": false

Solution 7 - Visual Studio-Code

Here is how to set this from UI level if you do not want to edit files directly: File -> Preferences -> Workbench -> List: Open mode = 'doubleClick'

or

File -> Preferences -> search for 'Open mode' and set it to 'doubleClick'

Solution 8 - Visual Studio-Code

So I had to do both suggestions by @Alex and @MichaelJ.Calkins. More specifically I had to configure the open mode setting to click and enable preview to true. That way I can preview with a single click and actually keep it open with a double click. Below are the settings that were configured.

"workbench.list.openMode": "singleClick",

"workbench.editor.enablePreview": true,

Solution 9 - Visual Studio-Code

Another configuration entry (above the "workbench.editor.enablePreview": true) that can prevent VSCode from opening files on new tab is the following:

"workbench.editor.showTabs": false

Make sure it is removed from settings.json or it is set to true.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionGratefulView Question on Stackoverflow
Solution 1 - Visual Studio-CodeAlexView Answer on Stackoverflow
Solution 2 - Visual Studio-CodeMichael J. CalkinsView Answer on Stackoverflow
Solution 3 - Visual Studio-CodeImtiaz SakibView Answer on Stackoverflow
Solution 4 - Visual Studio-CodeAndy BrownView Answer on Stackoverflow
Solution 5 - Visual Studio-CodeDávid MolnárView Answer on Stackoverflow
Solution 6 - Visual Studio-CodemsdosView Answer on Stackoverflow
Solution 7 - Visual Studio-CodeStrabekView Answer on Stackoverflow
Solution 8 - Visual Studio-CodeJandView Answer on Stackoverflow
Solution 9 - Visual Studio-CodeDávid KonkolyView Answer on Stackoverflow