Register global keybindings
(cx: &mut App)
| 43 | cx.activate(true); |
| 44 | }); |
| 45 | } |
| 46 | |
| 47 | /// Register global actions |
| 48 | fn register_actions(cx: &mut App) { |
| 49 | cx.on_action(|_: &Quit, cx| { |
| 50 | cx.quit(); |
| 51 | }); |
| 52 | } |
| 53 | |
| 54 | /// Register global keybindings |
| 55 | fn register_keybindings(cx: &mut App) { |
| 56 | cx.bind_keys([ |
| 57 | // ============ Application ============ |
| 58 | KeyBinding::new("cmd-q", Quit, None), |
| 59 | // ============ Request Actions ============ |
| 60 | KeyBinding::new("cmd-enter", SendRequest, None), |
| 61 | KeyBinding::new("ctrl-enter", SendRequest, None), |
| 62 | KeyBinding::new("cmd-.", CancelRequest, None), |
| 63 | KeyBinding::new("cmd-n", NewRequest, None), |
| 64 | KeyBinding::new("cmd-d", DuplicateRequest, None), |
| 65 | // ============ Tab Navigation ============ |
| 66 | KeyBinding::new("ctrl-tab", NextTab, None), |
| 67 | KeyBinding::new("cmd-shift-]", NextTab, None), |
| 68 | KeyBinding::new("alt-cmd-right", NextTab, None), |
| 69 | KeyBinding::new("ctrl-shift-tab", PreviousTab, None), |
| 70 | KeyBinding::new("cmd-shift-[", PreviousTab, None), |
| 71 | KeyBinding::new("alt-cmd-left", PreviousTab, None), |
| 72 | KeyBinding::new("cmd-w", CloseTab, None), |
| 73 | KeyBinding::new("cmd-shift-w", CloseAllTabs, None), |
| 74 | KeyBinding::new("cmd-alt-w", CloseOtherTabs, None), |
| 75 | // Go to specific tab (like browsers/VSCode) |
| 76 | KeyBinding::new("cmd-1", GoToTab1, None), |
| 77 | KeyBinding::new("cmd-2", GoToTab2, None), |
| 78 | KeyBinding::new("cmd-3", GoToTab3, None), |
| 79 | KeyBinding::new("cmd-4", GoToTab4, None), |
| 80 | KeyBinding::new("cmd-5", GoToTab5, None), |
| 81 | KeyBinding::new("cmd-6", GoToTab6, None), |
| 82 | KeyBinding::new("cmd-7", GoToTab7, None), |
| 83 | KeyBinding::new("cmd-8", GoToTab8, None), |
| 84 | KeyBinding::new("cmd-9", GoToLastTab, None), |
| 85 | // ============ Focus & Navigation ============ |
| 86 | KeyBinding::new("cmd-l", FocusUrlBar, None), |
| 87 | KeyBinding::new("cmd-u", FocusUrlBar, None), |
| 88 | KeyBinding::new("cmd-shift-b", SwitchToBodyTab, None), |
| 89 | KeyBinding::new("cmd-shift-p", SwitchToParamsTab, None), |
| 90 | KeyBinding::new("cmd-shift-h", SwitchToHeadersTab, None), |
| 91 | KeyBinding::new("cmd-shift-a", SwitchToAuthTab, None), |
| 92 | KeyBinding::new("cmd-alt-b", SwitchToResponseBody, None), |
| 93 | KeyBinding::new("cmd-alt-h", SwitchToResponseHeaders, None), |
| 94 | // ============ UI Toggles ============ |
| 95 | KeyBinding::new("cmd-k", ToggleCommandPalette, None), |
| 96 | KeyBinding::new("cmd-p", ToggleCommandPalette, None), |
| 97 | KeyBinding::new("cmd-b", ToggleSidebar, None), |
| 98 | KeyBinding::new("cmd-\\", ToggleSidebar, None), |
| 99 | // ============ History ============ |
| 100 | KeyBinding::new("cmd-shift-delete", ClearHistory, None), |
| 101 | // ============ HTTP Method Shortcuts ============ |
| 102 | // Alt + first letter (like Postman) |
nothing calls this directly
no outgoing calls
no test coverage detected