Skip to content

Commit

Permalink
Updated VS Code Key bindings (#1667)
Browse files Browse the repository at this point in the history
  • Loading branch information
thecarlo authored Jun 16, 2024
1 parent f9826ac commit 292cc08
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 151 deletions.
18 changes: 11 additions & 7 deletions public/extra_descriptions/vs_code.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
<td style="width: 300px;">Caps Lock Hyper Key + s</td>
<td>Navigate symbols (search symbols)</td>
</tr>
<tr>
<td style="width: 300px;">Caps Lock Hyper Key + d</td>
<td>Command palette</td>
</tr>
</table>

<p style="margin-top: 20px; font-weight: bold">
Expand All @@ -42,16 +46,16 @@

<table class="table">
<tr>
<td style="width: 300px;">Double-tap left ctrl</td>
<td>Toggle sidebar</td>
<td style="width: 300px;">Caps Lock Hyper Key + q</td>
<td>Toggle Zen mode</td>
</tr>
<tr>
<td style="width: 300px;">Double-tap left option</td>
<td>Toggle terminal</td>
<td style="width: 300px;">Caps Lock Hyper Key + w</td>
<td>Toggle sidebar</td>
</tr>
<tr>
<td style="width: 300px;">Double-tap left cmd</td>
<td>Toggle Zen mode</td>
<td style="width: 300px;">Caps Lock Hyper Key + e</td>
<td>Toggle terminal</td>
</tr>
<tr>
<td style="width: 300px;">Right cmd</td>
Expand All @@ -60,7 +64,7 @@
</table>

<p style="margin-top: 20px; font-weight: bold">
keybindings.json in Visual Studio Code
keybindings.json in Visual Studio Code
</p>
<p>
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.
Expand Down
189 changes: 45 additions & 144 deletions public/json/vs_code.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
]
},
Expand Down

0 comments on commit 292cc08

Please sign in to comment.