Skip to content

Instantly share code, notes, and snippets.

@kofta999
Created April 3, 2025 22:46
Show Gist options
  • Select an option

  • Save kofta999/77fe78491830da3c7e252ceb2857e37c to your computer and use it in GitHub Desktop.

Select an option

Save kofta999/77fe78491830da3c7e252ceb2857e37c to your computer and use it in GitHub Desktop.
Zed config files
[
{
"context": "Editor && (vim_mode == normal || vim_mode == visual) && !VimWaiting && !menu",
"bindings": {
// put key-bindings here if you want them to work in normal & visual mode
// Git
"space g h d": "editor::ToggleSelectedDiffHunks",
"space g h r": "git::Restore",
// Toggle inlay hints
"space t i": "editor::ToggleInlayHints",
// Toggle soft wrap
"space u w": "editor::ToggleSoftWrap",
// NOTE: Toggle Zen mode, not fully working yet
"space c z": "workspace::ToggleCenteredLayout",
// Open markdown preview
"space m p": "markdown::OpenPreview",
"space m P": "markdown::OpenPreviewToTheSide",
// Open recent project
"space f p": "projects::OpenRecent",
// Search word under cursor
// "space s w": "pane::DeploySearch",
// Chat with AI
"space a a": "assistant::ToggleFocus",
// Go to file with `gf`
"g f": "editor::OpenExcerpts"
}
},
{
"context": "Editor && vim_mode == normal && !VimWaiting && !menu",
"bindings": {
"ctrl-h": "workspace::ActivatePaneLeft",
"ctrl-l": "workspace::ActivatePaneRight",
"ctrl-k": "workspace::ActivatePaneUp",
"ctrl-j": "workspace::ActivatePaneDown",
// +LSP
"space .": "editor::ToggleCodeActions",
"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",
"] d": "editor::GoToDiagnostic",
"[ d": "editor::GoToPreviousDiagnostic",
// TODO: Go to next/prev error
"] e": "editor::GoToDiagnostic",
"[ e": "editor::GoToPreviousDiagnostic",
// Symbol search
"s s": "outline::Toggle",
"s S": "project_symbols::Toggle",
// Diagnostic
"space x x": "diagnostics::Deploy",
"space e": "project_panel::ToggleFocus",
"ctrl-/": "workspace::ToggleBottomDock",
"space p": "editor::Format",
"space space": "file_finder::Toggle",
"shift-l": "pane::ActivateNextItem",
"shift-h": "pane::ActivatePreviousItem",
"space v": "pane::SplitRight",
"space h": "workspace::ActivateNextPane",
"space l": "workspace::ActivatePreviousPane",
"space c a": "editor::ToggleCodeActions",
"q": "pane::CloseActiveItem",
"shift-q": "pane::CloseInactiveItems",
"space c r": "editor::Rename"
}
},
// Empty pane, set of keybindings that are available when there is no active editor
{
"context": "EmptyPane || SharedScreen",
"bindings": {
// Open file finder
"space space": "file_finder::Toggle",
// Open recent project
"space f p": "projects::OpenRecent"
}
},
// Comment code
{
"context": "Editor && vim_mode == visual && !VimWaiting && !menu",
"bindings": {
// visual, visual line & visual block modes
"g c": "editor::ToggleComments"
}
},
// Better escape
{
"context": "Editor && vim_mode == insert && !menu",
"bindings": {
"j j": "vim::NormalBefore", // remap jj in insert mode to escape
"j k": "vim::NormalBefore" // remap jk in insert mode to escape
}
},
{
"context": "Editor && vim_mode == insert",
"bindings": {
"alt-h": "vim::Left",
"alt-l": "vim::Right",
"alt-j": "vim::Down",
"alt-k": "vim::Up"
}
},
{
"context": "Editor && vim_mode == visual",
"bindings": {
"shift-j": "editor::MoveLineDown",
"shift-k": "editor::MoveLineUp"
}
},
// File panel
{
"context": "ProjectPanel && not_editing",
"bindings": {
"space e": "workspace::ToggleRightDock",
"a": "project_panel::NewFile",
"n": "project_panel::NewFile",
"shift-n": "project_panel::NewDirectory",
"d": "project_panel::Trash",
"l": "project_panel::Open",
"r": "project_panel::Rename",
"x": "project_panel::Cut",
"c": "project_panel::Copy",
"p": "project_panel::Paste",
"ctrl-h": "workspace::ActivatePaneLeft",
"ctrl-l": "workspace::ActivatePaneRight",
"ctrl-k": "workspace::ActivatePaneUp",
"ctrl-j": "workspace::ActivatePaneDown"
}
},
// 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": "Terminal",
"bindings": {
"ctrl-/": "workspace::ToggleBottomDock",
"ctrl-h": "workspace::ActivatePaneLeft",
"ctrl-l": "workspace::ActivatePaneRight",
"ctrl-k": "workspace::ActivatePaneUp",
"ctrl-j": "workspace::ActivatePaneDown",
"ctrl-shift-l": "pane::ActivateNextItem",
"ctrl-shift-h": "pane::ActivatePreviousItem"
}
}
// {
// "context": "VimControl && !menu",
// "bindings": {
// "w": "vim::NextSubwordStart",
// "b": "vim::PreviousSubwordStart",
// "e": "vim::NextSubwordEnd",
// "g e": "vim::PreviousSubwordEnd"
// }
// }
]
// Zed settings
//
// For information on how to configure Zed, see the Zed
// documentation: https://zed.dev/docs/configuring-zed
//
// To see all of Zed's default settings without changing your
// custom settings, run the `open default settings` command
// from the command palette or from `Zed` application menu.
{
// "base_keymap": "VSCode",
// Move all panel to the right
"features": {
"edit_prediction_provider": "zed"
},
"icon_theme": "Catppuccin Mocha",
"project_panel": {
"button": true,
"dock": "right",
"git_status": true,
"show_diagnostics": "all"
},
"outline_panel": {
"dock": "right"
},
"max_tabs": 5,
"collaboration_panel": {
"dock": "left"
},
// Move some unnecessary panels to the left
"notification_panel": {
"dock": "left"
},
"chat_panel": {
"dock": "left"
},
"assistant": {
"default_model": {
"provider": "zed.dev",
"model": "claude-3-7-sonnet-latest"
},
"version": "2"
},
"show_edit_predictions": false,
"telemetry": {
"diagnostics": false,
"metrics": false
},
"vim_mode": true,
"ui_font_size": 16,
"buffer_font_size": 16.0,
"buffer_font_family": "GeistMono Nerd Font",
"theme": {
"mode": "system",
"light": "One Dark Pro",
"dark": "One Dark Pro"
},
// Indentation, rainbow indentation
"indent_guides": {
"enabled": true,
"coloring": "indent_aware"
},
"autosave": {
"after_delay": {
"milliseconds": 500
}
},
"buffer_font_features": {
"calt": false
},
"scrollbar": {
"show": "never"
},
"relative_line_numbers": true,
"file_scan_exclusions": [
"**/.git",
"**/.svn",
"**/.hg",
"**/CVS",
"**/.DS_Store",
"**/Thumbs.db",
"**/.classpath",
"**/.settings",
// above is default from Zed
"**/out",
"**/dist",
"**/.husky",
"**/.turbo",
"**/.vscode-test",
"**/.vscode",
"**/.next",
"**/.storybook",
"**/.tap",
"**/.nyc_output",
"**/report",
"**/node_modules"
],
"languages": {
// Refer https://zed.dev/docs/languages/javascript and https://zed.dev/docs/languages/typescript for more info
"TypeScript": {
"code_actions_on_format": {
"source.fixAll.eslint": true
},
"formatter": "auto"
},
"JavaScript": {
"code_actions_on_format": {
"source.fixAll.eslint": true
}
},
"Python": {
"format_on_save": { "language_server": { "name": "ruff" } },
"formatter": { "language_server": { "name": "ruff" } },
"language_servers": ["pyright", "ruff"]
},
"Zig": {
"language_servers": ["zls", "..."]
// "formatter": {
// "external": {
// "command": "zig-fmt",
// "arguments": ["{buffer_path}"]
// }
// }
}
},
// Use zed commit editor
"terminal": {
"env": {
"EDITOR": "zed --wait"
},
"scrollbar": {
"show": "always"
},
"default_height": 1000
},
// File syntax highlighting
"file_types": {
"Dockerfile": ["Dockerfile", "Dockerfile.*"],
"JSON": ["json", "jsonc", "*.code-snippets"]
},
"tabs": {
"file_icons": true,
"show_diagnostics": "all"
},
"lsp": {
"rust-analyzer": {
// "initialization_options": {
// // get more cargo-less diagnostics from rust-analyzer,
// // which might include false-positives (those can be turned off by their names)
// "diagnostics": {
// "experimental": {
// "enable": true
// }
// },
// // To disable the checking entirely
// // (ignores all cargo and check settings below)
"checkOnSave": false
// // To check the `lib` target only.
// "cargo": {
// "allTargets": false
// },
// // Use `-p` instead of `--workspace` for cargo check
// "check": {
// "workspace": false
// }
},
"zls": {
"binary": {
"path": "/home/kofta/.local/bin/zls"
},
"initialization_options": {
"enable_build_on_save": true
}
}
// "deno": {
// "settings": {
// "deno": {
// "enable": true
// }
// }
// }
// },
// "languages": {
// "TypeScript": {
// "language_servers": [
// "deno",
// "!typescript-language-server",
// "!vtsls",
// "!eslint"
// ],
// "formatter": "language_server"
// },
// "TSX": {
// "language_servers": [
// "deno",
// "!typescript-language-server",
// "!vtsls",
// "!eslint"
// ],
// "formatter": "language_server"
// }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment