-
Notifications
You must be signed in to change notification settings - Fork 279
Description
This is the place to be if you want to suggest a keybinding, or find a nice and (usually) easy task to start contributing.
Suggestions
| Name | Command/ Default |
Assignee/ PR/Issue |
|---|---|---|
| ✔️ |
workbench.action.files.save Mod+S |
@jakeday #1426 |
| Focus Tab # | workbench.action.openEditorAtIndex[1-9] Mod+1 - Mod+9 |
@leavengood |
| ✔️ |
workbench.action.previousEditor Mod+PgUp / Cmd+Shift+[ |
@leavengood #778/#1447 |
| ✔️ |
workbench.action.nextEditor Mod+PgDn / Cmd+Shift+] |
@leavengood #778/#1447 |
| Copy | input.copy? Mod+C |
@fanantoxa #1233 |
| Cut | input.cut? Mod+X |
@fanantoxa #1233 |
| Paste | input.paste? Mod+V |
@fanantoxa #1233 |
| Go to next error | editor.action.marker.nextInFiles F8 |
#1349 |
| Go to previous error | editor.action.marker.prevInFiles Shift + F8 |
#1349 |
| Go to next search result | search.action.focusNextSearchResult F4 |
|
| Go to previous search result | search.action.focusPreviousSearchResult Shift + F4 |
|
| Open settings | workbench.action.openSettings Cmd+, |
|
| ✔️ |
workbench.action.zoomIn Ctrl++ |
@ArtemDrozdov #1556/#1629 |
| ✔️ |
workbench.action.zoomOut Ctrl+- |
@ArtemDrozdov #1556/#1629 |
| ✔️ |
workbench.action.zoomReset Ctrl+0 |
@ArtemDrozdov #1556/#1629 |
Do you have other suggestions? Post a comment below! If the keybinding exists in vscode as well, it would be nice if you could post the name, command and default keybinding used there.
How to contribute
Keybindings are defined in KeyBindingsStoreConnector. Here's the keybinding for unfo, for example:
oni2/src/Store/KeyBindingsStoreConnector.re
Lines 162 to 166 in bb2df4c
| { | |
| key: "<D-Z>", | |
| command: "undo", | |
| condition: "editorTextFocus" |> WhenExpr.parse, | |
| }, |
When invoked this will generate a Command("undo") action, which needs to be handled in a Store somewhere. The undo comamnd is handled in VimStoreConnector here:
oni2/src/Store/VimStoreConnector.re
Line 855 in bb2df4c
| | Command("undo") => (state, undoEffect) |
Which invokes the effect defined a bit further up, here:
oni2/src/Store/VimStoreConnector.re
Lines 827 to 834 in bb2df4c
| let undoEffect = | |
| Isolinear.Effect.create(~name="vim.undo", () => { | |
| let _ = Vim.input("<esc>"); | |
| let _ = Vim.input("<esc>"); | |
| let cursors = Vim.input("u"); | |
| updateActiveEditorCursors(cursors); | |
| (); | |
| }); |
A lot of keybindings will be like this, just delegating to libvim to handle it. Some might require a bit more though, but a good place to start is to look into how this is done and vim, and whether it can be delegated in the same manner as this.
If you feel ready to tackle one of the suggestions above, post a comment below to lets us know, then dive in! If you have questions, the best place to ask is in the #dev channel on our Discord server.