feat: toggle comments with ctrl+c

This commit is contained in:
Karim Abou Zeid 2022-11-10 11:07:23 +01:00 committed by Leo Lüker
parent a4f099e0c0
commit ca2b93176c
4 changed files with 40 additions and 0 deletions

16
package.json generated
View File

@ -3763,6 +3763,22 @@
"addDigits": 9
}
},
{
"key": "Ctrl+C",
"when": "editorTextFocus && dance.mode == 'normal'",
"command": "editor.action.commentLine",
"args": {
"$exclude": []
}
},
{
"key": "Ctrl+C",
"when": "editorTextFocus && dance.mode == 'visual'",
"command": "editor.action.commentLine",
"args": {
"$exclude": []
}
},
{
"key": "Shift+;",
"when": "editorTextFocus && dance.mode == 'normal'",

View File

@ -852,6 +852,22 @@ const builtinKeybindings = [
addDigits: 9,
},
},
{
key: "Ctrl+C",
when: "editorTextFocus && dance.mode == 'normal'",
command: "editor.action.commentLine",
args: {
"$exclude": [],
},
},
{
key: "Ctrl+C",
when: "editorTextFocus && dance.mode == 'visual'",
command: "editor.action.commentLine",
args: {
"$exclude": [],
},
},
{
key: "Shift+;",
when: "editorTextFocus && dance.mode == 'normal'",

View File

@ -972,9 +972,16 @@ Miscellaneous commands that don't deserve their own category.
By default, Dance also exports the following keybindings for existing
commands:
<<<<<<< HEAD
| Keybinding | Command |
| -------------------- | -------------------------------------------- |
| `s-;` (core: normal) | `["workbench.action.showCommands", { ... }]` |
=======
| Keybinding | Command |
| ------------------------------ | -------------------------------------------- |
| `s-;` (normal), `s-;` (visual) | `["workbench.action.showCommands", { ... }]` |
| `c-c` (normal), `c-c` (visual) | `["editor.action.commentLine", { ... }]` |
>>>>>>> 9e59a1b (feat: toggle comments with ctrl+c)
<a name="cancel" />

View File

@ -14,6 +14,7 @@ import { ArgumentError, CancellationError, InputError } from "../utils/errors";
* | Keybinding | Command |
* | -------------------------------------------- | -------------------------------------------- |
* | `s-;` (helix: normal), `s-;` (helix: visual) | `["workbench.action.showCommands", { ... }]` |
* | `c-c` (helix: normal), `c-c` (helix: visual) | `["editor.action.commentLine", { ... }]` |
*/
declare module "./misc";