Skip to content
Tom Short edited this page Nov 7, 2021 · 2 revisions

Here is an option for a global window menu. This is adapted from the window menu on this page.

        "window": {
            "items": {
                "⎵ ": { "text": "navigate groups", "command": "workbench.action.navigateEditorGroups" },
                "f": { "text": "focus file explorer", "command": "workbench.explorer.fileView.focus" },
                "1": { "text": "focus first editor group", "command": "workbench.action.focusFirstEditorGroup" },
                "t": { "text": "toggle sidebar", "command": "workbench.action.toggleSidebarVisibility" },
                "s": { "text": "focus sidebar", "command": "workbench.action.focusSideBar" },
                "w": { "text": "close active editor", "command": "workbench.action.closeActiveEditor" },
                "c": { "text": "close group, keep editors", "command": "workbench.action.joinTwoGroups" },
                "C": { "text": "close group and editors", "command": "workbench.action.closeEditorsInGroup" },
                "v/": { "text": "vertical split", "command": "workbench.action.splitEditor" },
                "-": { "text": "horizontal split", "command": "workbench.action.splitEditorOrthogonal" },
                "r": { "text": "rotate", "command": "workbench.action.toggleEditorGroupLayout" },
                "m": { "text": "toggle maximize", "command": "workbench.action.toggleEditorWidths" },
                "o": { "text": "merge all groups", "command": "workbench.action.joinAllGroups" },
                "g": { "text": "show editors in group", "command": "workbench.action.quickOpenPreviousRecentlyUsedEditorInGroup" },
                "h": { "text": "focus left group", "command": "workbench.action.focusLeftGroup" },
                "j": { "text": "focus below group", "command": "workbench.action.focusBelowGroup" },
                "k": { "text": "focus above group", "command": "workbench.action.focusAboveGroup" },
                "l": { "text": "focus right group", "command": "workbench.action.focusRightGroup" },
                "H": { "text": "move group left", "command": "workbench.action.moveActiveEditorGroupLeft" },
                "J": { "text": "move group below", "command": "workbench.action.moveActiveEditorGroupDown" },
                "K": { "text": "move group above", "command": "workbench.action.moveActiveEditorGroupUp" },
                "L": { "text": "move group right", "command": "workbench.action.moveActiveEditorGroupRight" }
            }
        },

To define a trigger key globally, use the following in keybindings.json:

    {
        "key": "ctrl+w",
        "command": "dance.openMenu",
        "args": { "input": "window" },
    },

If you want this global key to work in terminals, you also need the following in settings.json:

    "terminal.integrated.commandsToSkipShell": ["dance.openMenu"],