Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show current file in sidebar explorer with focus in Visual Studio Code

Is there a shortcut to show current file in sidebar with focus on that file (when sidebar is closed)? Basicaly combination of workbench.files.action.showActiveFileInExplorer and workbench.files.action.focusFilesExplorer

Like in Resharper Shift+Alt+L: https://www.jetbrains.com/help/resharper/Navigation_and_Search__Locating_a_File_in_Solution_Explorer.html

like image 718
mardok Avatar asked Dec 01 '22 14:12

mardok


1 Answers

Extension macros:

settings.json Ctrl+,

"macros": {
    "showFileAndFocus": [
        "workbench.files.action.showActiveFileInExplorer",
        "workbench.files.action.focusFilesExplorer"
    ]
}

keybindings.json

{
    "key": "shift+alt+l",
    "command": "macros.showFileAndFocus"
}
like image 59
Alex Avatar answered Jun 08 '23 17:06

Alex