如何在侧边栏资源管理器中以Visual Studio Code为焦点显示当前文件

mar*_*dok 1 visual-studio-code

是否有快捷方式显示侧边栏中的当前文件,重点放在该文件上(关闭侧边栏时)?基本上是workbench.files.action.showActiveFileInExplorer和的组合workbench.files.action.focusFilesExplorer

就像在Resharper中一样Shift+Alt+Lhttps : //www.jetbrains.com/help/resharper/Navigation_and_Search__Locating_a_File_in_Solution_Explorer.html

Dou*_*oug 8

你不需要宏,你可以focusFilesExplorer单独使用快捷方式:

{
    "key": "shift+alt+l",
    "command": "workbench.files.action.focusFilesExplorer",
    "when": "editorTextFocus"
}
Run Code Online (Sandbox Code Playgroud)


Ale*_*lex 5

Extension macros:

settings.json Ctrl+,

"macros": {
    "showFileAndFocus": [
        "workbench.files.action.showActiveFileInExplorer",
        "workbench.files.action.focusFilesExplorer"
    ]
}
Run Code Online (Sandbox Code Playgroud)

keybindings.json

{
    "key": "shift+alt+l",
    "command": "macros.showFileAndFocus"
}
Run Code Online (Sandbox Code Playgroud)