emacs.json

 1// documentation: https://zed.dev/docs/key-bindings
 2//
 3// To see the default key bindings run `zed: open default keymap`
 4// from the command palette.
 5[
 6  {
 7    "bindings": {
 8      "ctrl-g": "menu::Cancel"
 9    }
10  },
11  {
12    "context": "Editor",
13    "bindings": {
14      "ctrl-g": "editor::Cancel",
15      "ctrl-x b": "tab_switcher::Toggle", // switch-to-buffer
16      "alt-g g": "go_to_line::Toggle", // goto-line
17      "alt-g alt-g": "go_to_line::Toggle", // goto-line
18      //"ctrl-space": "editor::SetMark",
19      "ctrl-f": "editor::MoveRight", // forward-char
20      "ctrl-b": "editor::MoveLeft", // backward-char
21      "ctrl-n": "editor::MoveDown", // next-line
22      "ctrl-p": "editor::MoveUp", // previous-line
23      "home": ["editor::MoveToBeginningOfLine", { "stop_at_soft_wraps": false }], // move-beginning-of-line
24      "end": ["editor::MoveToEndOfLine", { "stop_at_soft_wraps": false }], // move-end-of-line
25      "ctrl-a": ["editor::MoveToBeginningOfLine", { "stop_at_soft_wraps": false }], // move-beginning-of-line
26      "ctrl-e": ["editor::MoveToEndOfLine", { "stop_at_soft_wraps": false }], // move-end-of-line
27      "alt-f": "editor::MoveToNextSubwordEnd", // forward-word
28      "alt-b": "editor::MoveToPreviousSubwordStart", // backward-word
29      "alt-u": "editor::ConvertToUpperCase", // upcase-word
30      "alt-l": "editor::ConvertToLowerCase", // downcase-word
31      "alt-c": "editor::ConvertToUpperCamelCase", // capitalize-word
32      "alt-;": ["editor::ToggleComments", { "advance_downwards": false }],
33      "ctrl-x ctrl-;": "editor::ToggleComments",
34      "alt-.": "editor::GoToDefinition", // xref-find-definitions
35      "alt-,": "pane::GoBack", // xref-pop-marker-stack
36      "ctrl-x h": "editor::SelectAll", // mark-whole-buffer
37      "ctrl-d": "editor::Delete", // delete-char
38      "alt-d": "editor::DeleteToNextWordEnd", // kill-word
39      "ctrl-k": "editor::KillRingCut", // kill-line
40      "ctrl-w": "editor::Cut", // kill-region
41      "alt-w": "editor::Copy", // kill-ring-save
42      "ctrl-y": "editor::KillRingYank", // yank
43      "ctrl-_": "editor::Undo", // undo
44      "ctrl-/": "editor::Undo", // undo
45      "ctrl-x u": "editor::Undo", // undo
46      "ctrl-v": "editor::MovePageDown", // scroll-up
47      "alt-v": "editor::MovePageUp", // scroll-down
48      "ctrl-x [": "editor::MoveToBeginning", // beginning-of-buffer
49      "ctrl-x ]": "editor::MoveToEnd", // end-of-buffer
50      "alt-<": "editor::MoveToBeginning", // beginning-of-buffer
51      "alt->": "editor::MoveToEnd", // end-of-buffer
52      "ctrl-l": "editor::ScrollCursorCenterTopBottom", // recenter-top-bottom
53      "ctrl-s": "buffer_search::Deploy", // isearch-forward
54      "alt-^": "editor::JoinLines" // join-line
55    }
56  },
57  {
58    "context": "Workspace && !Terminal",
59    "bindings": {
60      "ctrl-x ctrl-c": "workspace::CloseWindow", // kill-emacs
61      "ctrl-x o": "workspace::ActivateNextPane", // other-window
62      "ctrl-x k": "pane::CloseActiveItem", // kill-buffer
63      "ctrl-x 0": "pane::CloseActiveItem", // delete-window
64      "ctrl-x 1": "pane::CloseInactiveItems", // delete-other-windows
65      "ctrl-x 2": "pane::SplitDown", // split-window-below
66      "ctrl-x 3": "pane::SplitRight", // split-window-right
67      "ctrl-x ctrl-f": "file_finder::Toggle", // find-file
68      "ctrl-x ctrl-s": "workspace::Save", // save-buffer
69      "ctrl-x ctrl-w": "workspace::SaveAs", // write-file
70      "ctrl-x s": "workspace::SaveAll" // save-some-buffers
71    }
72  },
73  {
74    "context": "BufferSearchBar > Editor",
75    "bindings": {
76      "ctrl-s": "search::SelectNextMatch",
77      "ctrl-r": "search::SelectPrevMatch",
78      "ctrl-g": "buffer_search::Dismiss"
79    }
80  },
81  {
82    "context": "Pane",
83    "bindings": {
84      "ctrl-alt-left": "pane::GoBack",
85      "ctrl-alt-right": "pane::GoForward"
86    }
87  }
88]