How to disable file auto-focus in VSCode Explorer panel when file is opened by navigating tabs?

后端 未结 1 1273
既然无缘
既然无缘 2021-01-11 16:44

I wonder if there is a setting or a feature request should be submitted for the following:

Currently, if you pick a file from the project explorer, it goes into its

1条回答
  •  逝去的感伤
    2021-01-11 17:24

    To answer the first part, if you add this to your workspace or user settings, vscode will no longer automatically show the currently active file in the file explorer.

    "explorer.autoReveal": false

    To answer the second part, if you like to have the current file focused but you don't like having the explorer section expanded all over the place, there is a command that can help you. If you put something like this in your keybindings, then whenever you feel the explorer has become unruly you can use the keyboard command. It is also available in the command palette ("Files: Collapse folders in explorer") and there is an icon in the file explorer that looks like this: [-]

    {
        "key": "ctrl+shift+t",
        "command": "workbench.files.action.collapseExplorerFolders",
        "when": ""
    }
    

    I have also created an extension that can automate this.

    0 讨论(0)
提交回复
热议问题