update zed keybindings

This commit is contained in:
Alexander Navarro 2026-02-09 16:06:08 -03:00
parent 42abb59588
commit cad4e125f4
3 changed files with 268 additions and 176 deletions

View file

@ -1,22 +1,178 @@
[
{
"context": "Editor && (vim_mode == normal || vim_mode == visual) && !VimWaiting && !menu",
"bindings": {
// Git
"ctrl-h": "workspace::ActivatePaneLeft",
"ctrl-l": "workspace::ActivatePaneRight",
"ctrl-k": "workspace::ActivatePaneUp",
"ctrl-j": "workspace::ActivatePaneDown",
"ctrl-shift-t": "terminal_panel::ToggleFocus"
}
},
{
// Normal mode
"context": "Editor && VimControl && !VimWaiting && !menu",
"bindings": {
"ctrl-t": "terminal_panel::ToggleFocus",
"space": null,
"|": "pane::SplitVertical",
"J": "vim::JoinLinesNoWhitespace",
"s": null,
"s a": "vim::PushAddSurrounds",
"s d": "vim::PushDeleteSurrounds",
"s c": "vim::PushChangeSurrounds",
"g S": "editor::SplitSelectionIntoLines",
"g s": "editor::SortLinesCaseSensitive",
"g m": "editor::DuplicateLineDown",
"g M": "editor::DuplicateLineUp",
"g x": "vim::Exchange",
"enter": "vim::PushSneak",
// Toggle inlay hints
"space u i": "editor::ToggleInlayHints",
// NOTE: Toggle Zen mode, not fully working yet
"space u z": "workspace::ToggleZoom",
// Open recent project
"space f p": "projects::OpenRecent",
// Search word under cursor
"space f w": "pane::DeploySearch",
"space u u": "workspace::CloseAllDocks",
"space f w": "pane::DeploySearch", // Search word under cursor
// Go to file with `gf`
"g f": "editor::OpenExcerpts"
"g f": "editor::OpenExcerpts",
"space e": "pane::RevealInProjectPanel",
"space l a": "editor::ToggleCodeActions",
"space l r": "editor::Rename",
"g d": "editor::GoToDefinition",
"g D": "editor::GoToDefinitionSplit",
"g i": "editor::GoToImplementation",
"g I": "editor::GoToImplementationSplit",
"g t": "editor::GoToTypeDefinition",
"g T": "editor::GoToTypeDefinitionSplit",
"g r": "editor::FindAllReferences",
"space l j": "editor::GoToDiagnostic",
"space l k": "editor::GoToPreviousDiagnostic",
"space f o": "outline::Toggle", // Symbol search
"space f O": "project_symbols::Toggle",
"space f q": "diagnostics::Deploy",
// +Git
"space g G": "git_panel::ToggleFocus",
"space g g": [
"task::Spawn",
{ "task_name": "LazyGit", "reveal_target": "center" }
],
"space g j": "editor::GoToHunk",
"space g k": "editor::GoToPreviousHunk",
// + Buffers
// Switch between buffers
"shift-h": "pane::ActivatePreviousItem",
"shift-l": "pane::ActivateNextItem",
// Close active panel
"space b c": "pane::CloseActiveItem",
"space b d": "pane::CloseActiveItem",
// Close other items
"space b o": "pane::CloseOtherItems",
// Save file
"ctrl-s": "workspace::Save",
// File finder
"space f f": "file_finder::Toggle",
// Project search
"space f W": "pane::DeploySearch"
}
},
{
"context": "vim_mode == visual",
"bindings": {
"p": ["vim::Paste", { "preserve_clipboard": true }],
"shift-j": "editor::MoveLineDown",
"shift-k": "editor::MoveLineUp",
"shift-s": "vim::PushAddSurrounds",
"g x": "vim::Exchange",
"g s": "editor::SortLinesCaseSensitive",
"g S": "editor::SplitSelectionIntoLines",
"g m": "editor::DuplicateSelection"
}
},
{
// Empty pane, set of keybindings that are available when there is no active editor
"context": "(EmptyPane || SharedScreen) && vim_mode != insert",
"bindings": {
// Open file finder
"space f f": "file_finder::Toggle",
// Open recent project
"space f p": "projects::OpenRecent"
}
},
{
"context": "Terminal",
"bindings": {
"ctrl-shift-n": "workspace::NewTerminal",
"ctrl-shift-h": "pane::ActivatePreviousItem",
"ctrl-shift-l": "pane::ActivateNextItem",
"ctrl-tab": "pane::ActivatePreviousItem",
"ctrl-shift-tab": "pane::ActivateNextItem",
"ctrl-shift-t": "workspace::CloseActiveDock",
"ctrl-!": ["pane::ActivateItem", 0],
"ctrl-\"": ["pane::ActivateItem", 1],
"ctrl-#": ["pane::ActivateItem", 2],
"ctrl-$": ["pane::ActivateItem", 3],
"ctrl-%": ["pane::ActivateItem", 4],
"ctrl-&": ["pane::ActivateItem", 5],
"ctrl-/": ["pane::ActivateItem", 6],
"ctrl-(": ["pane::ActivateItem", 7],
"ctrl-)": ["pane::ActivateItem", 8]
}
},
// File panel (netrw)
{
"context": "ProjectPanel",
"bindings": {
"a": "project_panel::NewFile",
"A": "project_panel::NewDirectory",
"r": "project_panel::Rename",
"d": "project_panel::Delete",
"x": "project_panel::Cut",
"c": "project_panel::Copy",
"p": "project_panel::Paste",
"y": "workspace::CopyRelativePath",
"Y": "workspace::CopyPath",
"o": "project_panel::OpenPermanent",
"enter": ["workspace::SendKeystrokes", "o space e"], // hack to close the file explorer on open
"space e": "workspace::ToggleLeftDock"
}
},
// Panel nagivation
{
"context": "vim_operator == a || vim_operator == i || vim_operator == sc",
"bindings": {
// mini.ai plugin behavior
"\\\"": "vim::MiniQuotes",
"[": "vim::MiniBrackets",
"]": "vim::MiniBrackets",
"q": "vim::MiniQuotes",
"b": "vim::MiniBrackets"
}
},
{
"context": "vim_operator == gx",
"bindings": {
"c": "vim::ClearExchange"
}
},
{
@ -44,145 +200,5 @@
"ctrl-k": "menu::SelectPrevious",
"ctrl-l": "menu::SelectNext"
}
},
{
"context": "Editor && VimControl && !VimWaiting && !menu",
"bindings": {
"|": "pane::SplitVertical",
// Window movement bindings
// Ctrl jklk to move between panes
"ctrl-h": "workspace::ActivatePaneLeft",
"ctrl-l": "workspace::ActivatePaneRight",
"ctrl-k": "workspace::ActivatePaneUp",
"ctrl-j": "workspace::ActivatePaneDown",
"space e": "pane::RevealInProjectPanel",
// +LSP
"space l a": "editor::ToggleCodeActions",
"space l r": "editor::Rename",
"g d": "editor::GoToDefinition",
"g D": "editor::GoToDefinitionSplit",
"g i": "editor::GoToImplementation",
"g I": "editor::GoToImplementationSplit",
"g t": "editor::GoToTypeDefinition",
"g T": "editor::GoToTypeDefinitionSplit",
"g r": "editor::FindAllReferences",
"space l j": "editor::GoToDiagnostic",
"space l k": "editor::GoToPreviousDiagnostic",
// Symbol search
"space f o": "outline::Toggle",
"space f O": "project_symbols::Toggle",
// Diagnostic
"space f q": "diagnostics::Deploy",
// +Git
// Git prev/next hunk
"space g j": "editor::GoToHunk",
"space g k": "editor::GoToPreviousHunk",
// + Buffers
// Switch between buffers
"shift-h": "pane::ActivatePreviousItem",
"shift-l": "pane::ActivateNextItem",
// Close active panel
"space b c": "pane::CloseActiveItem",
"space b d": "pane::CloseActiveItem",
// Close other items
"space b o": "pane::CloseOtherItems",
// Save file
"ctrl-s": "workspace::Save",
// File finder
"space f f": "file_finder::Toggle",
// Project search
"space f W": "pane::DeploySearch"
}
},
{
"context": "Editor && vim_mode == visual",
"bindings": {
"shift-j": "editor::MoveLineDown",
"shift-k": "editor::MoveLineUp"
}
},
// Empty pane, set of keybindings that are available when there is no active editor
{
"context": "(EmptyPane || SharedScreen) && vim_mode != insert",
"bindings": {
// Open file finder
"space f f": "file_finder::Toggle",
// Open recent project
"space f p": "projects::OpenRecent"
}
},
{
"context": "Workspace",
"bindings": {
"ctrl-t": "terminal_panel::ToggleFocus"
}
},
{
"context": "Terminal",
"bindings": {
"ctrl-h": "workspace::ActivatePaneLeft",
"ctrl-l": "workspace::ActivatePaneRight",
"ctrl-k": "workspace::ActivatePaneUp",
"ctrl-j": "workspace::ActivatePaneDown"
}
},
// File panel (netrw)
{
"context": "ProjectPanel && not_editing",
"bindings": {
"a": "project_panel::NewFile",
"A": "project_panel::NewDirectory",
"r": "project_panel::Rename",
"d": "project_panel::Delete",
"x": "project_panel::Cut",
"c": "project_panel::Copy",
"p": "project_panel::Paste",
"y": "workspace::CopyRelativePath",
"Y": "workspace::CopyPath",
"o": ["project_panel::Open", "workspace::toggleLeftDock"],
// Close project panel as project file panel on the right
// Navigate between panel
"ctrl-h": "workspace::ActivatePaneLeft",
"ctrl-l": "workspace::ActivatePaneRight",
"ctrl-k": "workspace::ActivatePaneUp",
"ctrl-j": "workspace::ActivatePaneDown",
"space e": "workspace::ToggleLeftDock"
}
},
// Panel nagivation
{
"context": "Dock",
"bindings": {
"ctrl-w h": "workspace::ActivatePaneLeft",
"ctrl-w l": "workspace::ActivatePaneRight",
"ctrl-w k": "workspace::ActivatePaneUp",
"ctrl-w j": "workspace::ActivatePaneDown"
}
},
{
"context": "vim_operator == a || vim_operator == i || vim_operator == cs",
"bindings": {
// mini.ai plugin behavior
"\"": "vim::MiniQuotes",
"[": "vim::MiniBrackets",
"]": "vim::MiniBrackets",
"q": "vim::MiniQuotes",
"b": "vim::MiniBrackets"
}
},
{
"context": "vim_mode == visual",
"bindings": {
"shift-s": "vim::PushAddSurrounds",
"g x": "vim::Exchange"
}
}
]

View file

@ -7,6 +7,7 @@
// custom settings, run `zed: open default settings` from the
// command palette (cmd-shift-p / ctrl-shift-p)
{
"semantic_tokens": "combined",
"formatter": "language_server",
"zoomed_padding": false,
"auto_install_extensions": {
@ -46,7 +47,8 @@
},
"scroll_beyond_last_line": "vertical_scroll_margin",
"which_key": {
"enabled": true
"enabled": true,
"delay_ms": 500
},
"rounded_selection": true,
"current_line_highlight": "gutter",

74
configs/zed/tasks.json Normal file
View file

@ -0,0 +1,74 @@
// Project tasks configuration. See https://zed.dev/docs/tasks for documentation.
//
// Example:
[
{
"label": "LazyGit",
"command": "lazygit",
"shell": {
"program": "sh"
},
"hide": "on_success",
"reveal_target": "center",
"show_summary": false,
"show_command": false,
"allow_concurrent_runs": true,
"use_new_terminal": true
},
{
"label": "Bun Test",
"command": "bun test",
"args": ["\"$ZED_RELATIVE_FILE\" -t=\"$ZED_SYMBOL\""],
"tags": ["js-test", "ts-test", "bun-test", "tsx-test"]
},
{
"label": "Example task",
"command": "for i in {1..5}; do echo \"Hello $i/5\"; sleep 1; done",
//"args": [],
// Env overrides for the command, will be appended to the terminal's environment from the settings.
"env": { "foo": "bar" },
// Current working directory to spawn the command into, defaults to current project root.
//"cwd": "/path/to/working/directory",
// Whether to use a new terminal tab or reuse the existing one to spawn the process, defaults to `false`.
"use_new_terminal": false,
// Whether to allow multiple instances of the same task to be run, or rather wait for the existing ones to finish, defaults to `false`.
"allow_concurrent_runs": false,
// What to do with the terminal pane and tab, after the command was started:
// * `always` always show the task's pane, and focus the corresponding tab in it (default)
// * `no_focus` always show the task's pane, add the task's tab in it, but don't focus it
// * `never` do not alter focus, but still add/reuse the task's tab in its pane
"reveal": "always",
// Where to place the task's terminal item after starting the task:
// * `dock` in the terminal dock, "regular" terminal items' place (default)
// * `center` in the central pane group, "main" editor area
"reveal_target": "dock",
// What to do with the terminal pane and tab, after the command had finished:
// * `never` Do nothing when the command finishes (default)
// * `always` always hide the terminal tab, hide the pane also if it was the last tab in it
// * `on_success` hide the terminal tab on task success only, otherwise behaves similar to `always`
"hide": "never",
// Which shell to use when running a task inside the terminal.
// May take 3 values:
// 1. (default) Use the system's default terminal configuration in /etc/passwd
// "shell": "system"
// 2. A program:
// "shell": {
// "program": "sh"
// }
// 3. A program with arguments:
// "shell": {
// "with_arguments": {
// "program": "/bin/bash",
// "args": ["--login"]
// }
// }
"shell": "system",
// Whether to show the task line in the output of the spawned task, defaults to `true`.
"show_summary": true,
// Whether to show the command line in the output of the spawned task, defaults to `true`.
"show_command": true
// Represents the tags for inline runnable indicators, or spawning multiple tasks at once.
// "tags": []
}
]