From 292cc082ed71870ffc460b24e8dea1ca49454b6c Mon Sep 17 00:00:00 2001 From: Carlo van Wyk <5310264+thecarlo@users.noreply.github.com> Date: Sun, 16 Jun 2024 12:37:33 +1000 Subject: [PATCH] Updated VS Code Key bindings (#1667) --- public/extra_descriptions/vs_code.html | 18 ++- public/json/vs_code.json | 189 ++++++------------------- 2 files changed, 56 insertions(+), 151 deletions(-) diff --git a/public/extra_descriptions/vs_code.html b/public/extra_descriptions/vs_code.html index a5867aa2d..f52ac415e 100644 --- a/public/extra_descriptions/vs_code.html +++ b/public/extra_descriptions/vs_code.html @@ -34,6 +34,10 @@ Caps Lock Hyper Key + s Navigate symbols (search symbols) + + Caps Lock Hyper Key + d + Command palette +

@@ -42,16 +46,16 @@ - - + + - - + + - - + + @@ -60,7 +64,7 @@
Double-tap left ctrlToggle sidebarCaps Lock Hyper Key + qToggle Zen mode
Double-tap left optionToggle terminalCaps Lock Hyper Key + wToggle sidebar
Double-tap left cmdToggle Zen modeCaps Lock Hyper Key + eToggle terminal
Right cmd

-keybindings.json in Visual Studio Code + keybindings.json in Visual Studio Code

Add the following entry to your keybindings.json in Visual Studio Code. This is to ensure that the editor pane is focused when activating the Zen mode shortcuts. diff --git a/public/json/vs_code.json b/public/json/vs_code.json index bc26169ce..0a4eb5ae6 100644 --- a/public/json/vs_code.json +++ b/public/json/vs_code.json @@ -155,223 +155,124 @@ ] }, { - "description": "VS Code: double-tap left ctrl → toggle sidebar", + "description": "VS Code: Caps Lock Hyper Key + d → command palette", "manipulators": [ { "conditions": [ - { - "name": "left_ctrl pressed", - "type": "variable_if", - "value": 1 - }, { "type": "frontmost_application_if", "bundle_identifiers": ["^com\\.microsoft\\.VSCode$", "^com\\.microsoft\\.VSCodeInsiders"] } ], + "type": "basic", "from": { - "key_code": "left_control", + "key_code": "d", "modifiers": { + "mandatory": ["left_control", "left_shift", "right_command"], "optional": ["any"] } }, "to": [ { - "key_code": "b", - "modifiers": ["left_command"] + "key_code": "p", + "modifiers": ["left_shift", "left_command"] } - ], - "type": "basic" - }, + ] + } + ] + }, + { + "description": "VS Code: Caps Lock Hyper Key + q → zen mode", + "manipulators": [ { + "type": "basic", "from": { - "key_code": "left_control", + "key_code": "q", "modifiers": { + "mandatory": ["left_control", "left_shift", "right_command"], "optional": ["any"] } }, "to": [ { - "set_variable": { - "name": "left_ctrl pressed", - "value": 1 - } - }, - { - "key_code": "left_control" + "key_code": "f", + "modifiers": ["left_control", "left_shift", "left_option"] } ], "to_delayed_action": { - "to_if_canceled": [ - { - "set_variable": { - "name": "left_ctrl pressed", - "value": 0 - } - } - ], "to_if_invoked": [ { - "set_variable": { - "name": "left_ctrl pressed", - "value": 0 - } + "key_code": "k", + "modifiers": ["left_command"] + }, + { + "key_code": "z" + }, + { + "key_code": "escape" } ] }, - "type": "basic" + "conditions": [ + { + "type": "frontmost_application_if", + "bundle_identifiers": ["^com\\.microsoft\\.VSCode$", "^com\\.microsoft\\.VSCodeInsiders"] + } + ] } ] }, { - "description": "VS Code: double-tap left option → hide terminal", + "description": "VS Code: Caps Lock Hyper Key + w → toggle sidebar", "manipulators": [ { "conditions": [ - { - "name": "left_option pressed", - "type": "variable_if", - "value": 1 - }, { "type": "frontmost_application_if", "bundle_identifiers": ["^com\\.microsoft\\.VSCode$", "^com\\.microsoft\\.VSCodeInsiders"] } ], + "type": "basic", "from": { - "key_code": "left_option", + "key_code": "w", "modifiers": { + "mandatory": ["left_control", "left_shift", "right_command"], "optional": ["any"] } }, "to": [ { - "key_code": "j", + "key_code": "b", "modifiers": ["left_command"] } - ], - "type": "basic" - }, - { - "from": { - "key_code": "left_option", - "modifiers": { - "optional": ["any"] - } - }, - "to": [ - { - "set_variable": { - "name": "left_option pressed", - "value": 1 - } - }, - { - "key_code": "left_option" - } - ], - "to_delayed_action": { - "to_if_canceled": [ - { - "set_variable": { - "name": "left_option pressed", - "value": 0 - } - } - ], - "to_if_invoked": [ - { - "set_variable": { - "name": "left_option pressed", - "value": 0 - } - } - ] - }, - "type": "basic" + ] } ] }, { - "description": "VS Code: double-tap left cmd → zen mode", + "description": "VS Code: Caps Lock Hyper Key + e → toggle terminal", "manipulators": [ { "conditions": [ - { - "name": "left_command pressed", - "type": "variable_if", - "value": 1 - }, { "type": "frontmost_application_if", "bundle_identifiers": ["^com\\.microsoft\\.VSCode$", "^com\\.microsoft\\.VSCodeInsiders"] } ], + "type": "basic", "from": { - "key_code": "left_command", - "modifiers": { - "optional": ["any"] - } - }, - "to": [ - { - "key_code": "f", - "modifiers": ["left_control", "left_shift", "left_option"] - } - ], - "to_delayed_action": { - "to_if_invoked": [ - { - "key_code": "k", - "modifiers": ["left_command"] - }, - { - "key_code": "z" - }, - { - "key_code": "escape" - } - ] - }, - "type": "basic" - }, - { - "from": { - "key_code": "left_command", + "key_code": "e", "modifiers": { + "mandatory": ["left_control", "left_shift", "right_command"], "optional": ["any"] } }, "to": [ { - "set_variable": { - "name": "left_command pressed", - "value": 1 - } - }, - { - "key_code": "left_command" + "key_code": "j", + "modifiers": ["left_command"] } - ], - "to_delayed_action": { - "to_if_canceled": [ - { - "set_variable": { - "name": "left_command pressed", - "value": 0 - } - } - ], - "to_if_invoked": [ - { - "set_variable": { - "name": "left_command pressed", - "value": 0 - } - } - ] - }, - "type": "basic" + ] } ] },