Skip to repository content

tenant.openagents/omega

No repository description is available.

OpenAgents Git authority 2026-07-28T02:34:51.510Z Public web read
NIP-34 coordinate30617:7649603503856e5148d571eac2766b288a8ff1e9e35d380337a1d2b0015b4f92:omega
MaintainersHidden in public view
References2 branches · 1 tag
Read-only clonegit clone https://openagents.com/git/tenant.openagents/omega.git
Browse files

emacs.json

210 lines · 10.1 KB · json
1// documentation: https://zed.dev/docs/key-bindings
2//
3// To see the default key bindings run `omega: open default keymap`
4// from the command palette.
5[
6  {
7    "bindings": {
8      "ctrl-g": "menu::Cancel",
9    },
10  },
11  {
12    // Workaround to avoid falling back to default bindings.
13    // Unbind so Omega ignores these keys and lets emacs handle them.
14    // NOTE: must be declared before the `Editor` override.
15    // NOTE: in macos the 'ctrl-x' 'ctrl-p' and 'ctrl-n' rebindings are not needed, since they default to 'cmd'.
16    "context": "Editor",
17    "bindings": {
18      "ctrl-g": null, // currently activates `go_to_line::Toggle` when there is nothing to cancel
19      "ctrl-x": null, // currently activates `editor::Cut` if no following key is pressed for 1 second
20      // `null` only stops binding resolution in a user keymap, so these use a targeted unbind:
21      // `editor::MoveUp`/`MoveDown` propagate when the cursor doesn't move, which at the ends of
22      // the buffer would otherwise fall through to these.
23      "ctrl-p": ["omega::Unbind", "file_finder::Toggle"],
24      "ctrl-n": ["omega::Unbind", "workspace::NewFile"],
25    },
26  },
27  {
28    "context": "Editor",
29    "bindings": {
30      "ctrl-g": "editor::Cancel",
31      "alt-g g": "go_to_line::Toggle", // goto-line
32      "alt-g alt-g": "go_to_line::Toggle", // goto-line
33      "ctrl-space": "editor::SetMark", // set-mark
34      "ctrl-@": "editor::SetMark", // set-mark
35      "ctrl-x ctrl-x": "editor::SwapSelectionEnds", // exchange-point-and-mark
36      "ctrl-f": "editor::MoveRight", // forward-char
37      "ctrl-b": "editor::MoveLeft", // backward-char
38      "ctrl-n": "editor::MoveDown", // next-line
39      "ctrl-p": "editor::MoveUp", // previous-line
40      "home": ["editor::MoveToBeginningOfLine", { "stop_at_soft_wraps": false }], // move-beginning-of-line
41      "end": ["editor::MoveToEndOfLine", { "stop_at_soft_wraps": false }], // move-end-of-line
42      "ctrl-a": ["editor::MoveToBeginningOfLine", { "stop_at_soft_wraps": false }], // move-beginning-of-line
43      "ctrl-e": ["editor::MoveToEndOfLine", { "stop_at_soft_wraps": false }], // move-end-of-line
44      "shift-home": ["editor::SelectToBeginningOfLine", { "stop_at_soft_wraps": false }], // move-beginning-of-line
45      "shift-end": ["editor::SelectToEndOfLine", { "stop_at_soft_wraps": false }], // move-end-of-line
46      "alt-m": ["editor::MoveToBeginningOfLine", { "stop_at_soft_wraps": false, "stop_at_indent": true }], // back-to-indentation
47      "alt-left": "editor::MoveToPreviousWordStart", // left-word
48      "alt-right": "editor::MoveToNextWordEnd", // right-word
49      "alt-f": "editor::MoveToNextWordEnd", // forward-word
50      "alt-b": "editor::MoveToPreviousWordStart", // backward-word
51      "alt-u": "editor::ConvertToUpperCase", // upcase-word
52      "alt-l": "editor::ConvertToLowerCase", // downcase-word
53      "alt-c": "editor::ConvertToUpperCamelCase", // capitalize-word
54      "ctrl-t": "editor::Transpose", // transpose-chars
55      "alt-;": ["editor::ToggleComments", { "advance_downwards": false }],
56      "ctrl-x ctrl-;": "editor::ToggleComments",
57      "alt-.": "editor::GoToDefinition", // xref-find-definitions
58      "alt-?": "editor::FindAllReferences", // xref-find-references
59      "alt-,": "pane::GoBack", // xref-pop-marker-stack
60      "ctrl-x h": "editor::SelectAll", // mark-whole-buffer
61      "ctrl-d": "editor::Delete", // delete-char
62      "alt-d": ["editor::DeleteToNextWordEnd", { "ignore_newlines": false, "ignore_brackets": false }], // kill-word
63      "alt-backspace": "editor::DeleteToPreviousWordStart", // backward-kill-word
64      "alt-delete": "editor::DeleteToPreviousWordStart", // backward-kill-word
65      "ctrl-k": "editor::KillRingCut", // kill-line
66      "ctrl-w": "editor::Cut", // kill-region
67      "alt-w": "editor::Copy", // kill-ring-save
68      "ctrl-y": "editor::KillRingYank", // yank
69      "ctrl-_": "editor::Undo", // undo
70      "ctrl-/": "editor::Undo", // undo
71      "ctrl-x u": "editor::Undo", // undo
72      "alt-{": "editor::MoveToStartOfParagraph", // backward-paragraph
73      "alt-}": "editor::MoveToEndOfParagraph", // forward-paragraph
74      "ctrl-up": "editor::MoveToStartOfParagraph", // backward-paragraph
75      "ctrl-down": "editor::MoveToEndOfParagraph", // forward-paragraph
76      "ctrl-v": "editor::MovePageDown", // scroll-up
77      "alt-v": "editor::MovePageUp", // scroll-down
78      "ctrl-x [": "editor::MoveToBeginning", // beginning-of-buffer
79      "ctrl-x ]": "editor::MoveToEnd", // end-of-buffer
80      "alt-<": "editor::MoveToBeginning", // beginning-of-buffer
81      "alt->": "editor::MoveToEnd", // end-of-buffer
82      "ctrl-home": "editor::MoveToBeginning", // beginning-of-buffer
83      "ctrl-end": "editor::MoveToEnd", // end-of-buffer
84      "ctrl-l": "editor::ScrollCursorCenterTopBottom", // recenter-top-bottom
85      "ctrl-s": "buffer_search::Deploy", // isearch-forward
86      "ctrl-r": "buffer_search::Deploy", // isearch-backward
87      "alt-^": "editor::JoinLines", // join-line
88      "alt-q": "editor::Rewrap", // fill-paragraph
89    },
90  },
91  {
92    "context": "Editor && selection_mode", // region selection
93    "bindings": {
94      "right": "editor::SelectRight",
95      "left": "editor::SelectLeft",
96      "down": "editor::SelectDown",
97      "up": "editor::SelectUp",
98      "alt-left": "editor::SelectToPreviousWordStart",
99      "alt-right": "editor::SelectToNextWordEnd",
100      "pagedown": "editor::SelectPageDown",
101      "ctrl-v": "editor::SelectPageDown",
102      "pageup": "editor::SelectPageUp",
103      "alt-v": "editor::SelectPageUp",
104      "ctrl-f": "editor::SelectRight",
105      "ctrl-b": "editor::SelectLeft",
106      "ctrl-n": "editor::SelectDown",
107      "ctrl-p": "editor::SelectUp",
108      "home": ["editor::SelectToBeginningOfLine", { "stop_at_soft_wraps": false }],
109      "end": ["editor::SelectToEndOfLine", { "stop_at_soft_wraps": false }],
110      "ctrl-a": ["editor::SelectToBeginningOfLine", { "stop_at_soft_wraps": false }],
111      "ctrl-e": ["editor::SelectToEndOfLine", { "stop_at_soft_wraps": false }],
112      "alt-m": ["editor::SelectToBeginningOfLine", { "stop_at_soft_wraps": false, "stop_at_indent": true }],
113      "alt-f": "editor::SelectToNextWordEnd",
114      "alt-b": "editor::SelectToPreviousWordStart",
115      "alt-{": "editor::SelectToStartOfParagraph",
116      "alt-}": "editor::SelectToEndOfParagraph",
117      "ctrl-up": "editor::SelectToStartOfParagraph",
118      "ctrl-down": "editor::SelectToEndOfParagraph",
119      "ctrl-x [": "editor::SelectToBeginning",
120      "ctrl-x ]": "editor::SelectToEnd",
121      "alt-<": "editor::SelectToBeginning",
122      "alt->": "editor::SelectToEnd",
123      "ctrl-home": "editor::SelectToBeginning",
124      "ctrl-end": "editor::SelectToEnd",
125      "ctrl-g": "editor::Cancel",
126    },
127  },
128  {
129    "context": "Editor && (showing_code_actions || showing_completions)",
130    "bindings": {
131      "ctrl-p": "editor::ContextMenuPrevious",
132      "ctrl-n": "editor::ContextMenuNext",
133    },
134  },
135  {
136    "context": "Editor && showing_signature_help && !showing_completions",
137    "bindings": {
138      "ctrl-p": "editor::SignatureHelpPrevious",
139      "ctrl-n": "editor::SignatureHelpNext",
140    },
141  },
142  // Example setting for using emacs-style tab
143  // (i.e. indent the current line / selection or perform symbol completion depending on context)
144  // {
145  //   "context": "Editor && !showing_code_actions && !showing_completions",
146  //   "bindings": {
147  //     "tab": "editor::AutoIndent" // indent-for-tab-command
148  //   }
149  // },
150  {
151    "context": "Workspace",
152    "bindings": {
153      "alt-x": "command_palette::Toggle", // execute-extended-command
154      "ctrl-x b": "tab_switcher::Toggle", // switch-to-buffer
155      "ctrl-x ctrl-b": "tab_switcher::Toggle", // list-buffers
156      // "ctrl-x ctrl-c": "workspace::CloseWindow" // in case you only want to exit the current Omega instance
157      "ctrl-x ctrl-c": "omega::Quit", // save-buffers-kill-terminal
158      "ctrl-x 5 0": "workspace::CloseWindow", // delete-frame
159      "ctrl-x 5 2": "workspace::NewWindow", // make-frame-command
160      "ctrl-x o": "workspace::ActivateNextPane", // other-window
161      "ctrl-x k": "pane::CloseActiveItem", // kill-buffer
162      "ctrl-x 0": "pane::CloseActiveItem", // delete-window
163      // "ctrl-x 1": "pane::JoinAll", // in case you prefer to delete the splits but keep the buffers open
164      "ctrl-x 1": "pane::CloseOtherItems", // delete-other-windows
165      "ctrl-x 2": "pane::SplitDown", // split-window-below
166      "ctrl-x 3": "pane::SplitRight", // split-window-right
167      "ctrl-x ctrl-f": "file_finder::Toggle", // find-file
168      "ctrl-x ctrl-s": "workspace::Save", // save-buffer
169      "ctrl-x ctrl-w": "workspace::SaveAs", // write-file
170      "ctrl-x s": "workspace::SaveAll", // save-some-buffers
171    },
172  },
173  {
174    // Workaround to enable using native emacs from the Omega terminal.
175    // Unbind so Omega ignores these keys and lets emacs handle them.
176    // NOTE:
177    //  "terminal::SendKeystroke" only works for a single key stroke (e.g. ctrl-x),
178    //  so override with null for compound sequences (e.g. ctrl-x ctrl-c).
179    "context": "Terminal",
180    "bindings": {
181      // If you want to perfect your emacs-in-omega setup, also consider the following.
182      // You may need to enable "option_as_meta" from the Omega settings for "alt-x" to work.
183      // "alt-x": ["terminal::SendKeystroke", "alt-x"],
184      // "ctrl-x": ["terminal::SendKeystroke", "ctrl-x"],
185      // "ctrl-n": ["terminal::SendKeystroke", "ctrl-n"],
186      // ...
187      "ctrl-x ctrl-c": null, // save-buffers-kill-terminal
188      "ctrl-x ctrl-f": null, // find-file
189      "ctrl-x ctrl-s": null, // save-buffer
190      "ctrl-x ctrl-w": null, // write-file
191      "ctrl-x s": null, // save-some-buffers
192    },
193  },
194  {
195    "context": "BufferSearchBar > Editor",
196    "bindings": {
197      "ctrl-s": "search::SelectNextMatch",
198      "ctrl-r": "search::SelectPreviousMatch",
199      "ctrl-g": "buffer_search::Dismiss",
200    },
201  },
202  {
203    "context": "Pane",
204    "bindings": {
205      "ctrl-alt-left": "pane::GoBack",
206      "ctrl-alt-right": "pane::GoForward",
207    },
208  },
209]
210
Served at tenant.openagents/omega Member data and write actions are omitted.