Skip to content

Keybinding Suggestions and Contribution Opportunities #1423

@glennsl

Description

@glennsl

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
✔️ Save workbench.action.files.save
Mod+S
@jakeday
#1426
Focus Tab # workbench.action.openEditorAtIndex[1-9]
Mod+1 - Mod+9
@leavengood
✔️ Previous Tab workbench.action.previousEditor
Mod+PgUp / Cmd+Shift+[
@leavengood
#778/#1447
✔️ Next Tab 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+,
✔️ Zoom In workbench.action.zoomIn
Ctrl++
@ArtemDrozdov
#1556/#1629
✔️ Zoom Out workbench.action.zoomOut
Ctrl+-
@ArtemDrozdov
#1556/#1629
✔️ Zoom Reset 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:

{
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:

| Command("undo") => (state, undoEffect)

Which invokes the effect defined a bit further up, here:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-configurationArea: Configuration, settings, options, preferences etc.A-inputArea: Input management, keyboard layout, IME etc.E-good-first-issueCall for participation: Good first issueE-help-wantedCall for participation: Help is requested to fix this issue.enhancementNew feature or requestmetaA big-picture issue, often collecting a number of other issues for discussing overarching solutions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions