Skip to main content

bindings

Function bindings 

Source
pub fn bindings() -> Vec<KeyBinding>
Expand description

The editor’s default keymap, as data, so an app can have it without having to take it. Scoped to the editor’s own key context, so binding tab here does not make tab mean “indent” for the whole app.

The chords are ui::input::TextField’s, because a document is not the place to invent a second set: what alt-left does in a search box is what a reader expects it to do here.

An app with a keymap of its own has three ways in, none of which is copying this list: bind over it (a later binding wins), bind gpui::NoAction to a chord to take it away, or skip init and bind a filtered bindings(). Either way the actions are public and CONTEXT names the scope, so what the editor answers to is the app’s to say.