From d5f1e5d640e26077026816c819fcd90618a126b5 Mon Sep 17 00:00:00 2001 From: jabuxas Date: Tue, 3 Dec 2024 13:16:16 -0300 Subject: [PATCH] feat(work): switch to zed --- .../configs/zed/.config/zed/keymap.json | 109 ++++++++++++++++ .../configs/zed/.config/zed/settings.json | 119 ++++++++++++++++++ 2 files changed, 228 insertions(+) create mode 100644 work-laptop/configs/zed/.config/zed/keymap.json create mode 100644 work-laptop/configs/zed/.config/zed/settings.json diff --git a/work-laptop/configs/zed/.config/zed/keymap.json b/work-laptop/configs/zed/.config/zed/keymap.json new file mode 100644 index 0000000..41d13cd --- /dev/null +++ b/work-laptop/configs/zed/.config/zed/keymap.json @@ -0,0 +1,109 @@ +// Zed keymap +// +// For information on binding keys, see the Zed +// documentation: https://zed.dev/docs/key-bindings +// +// To see the default key bindings run `zed: open default keymap` +// from the command palette. +[ + { + "context": "Workspace", + "bindings": {} + }, + { + "context": "Editor && vim_mode == normal && !VimWaiting && !menu", + "bindings": { + "space s f": "file_finder::Toggle", + "space c a": "editor::ToggleCodeActions", + "space o l": "assistant::ToggleFocus", + "space o p": "projects::OpenRecent", + "alt-.": "pane::ActivateNextItem", + "alt-,": "pane::ActivatePrevItem", + "alt-x": "pane::CloseActiveItem", + "alt-1": "project_panel::ToggleFocus", + "alt-2": "outline_panel::ToggleFocus", + "alt-3": "collab_panel::ToggleFocus", + "space o t": "terminal_panel::ToggleFocus", + "alt-4": "editor::ToggleTabBar", + "ctrl-d": ["vim::ScrollDown", "editor::ScrollCursorCenter"], + "ctrl-u": ["vim::ScrollUp", "editor::ScrollCursorCenter"], + "ctrl-h": ["workspace::ActivatePaneInDirection", "Left"], + "ctrl-l": ["workspace::ActivatePaneInDirection", "Right"], + "ctrl-k": ["workspace::ActivatePaneInDirection", "Up"], + "ctrl-j": ["workspace::ActivatePaneInDirection", "Down"], + "space a c": "assistant::ToggleFocus", + "space r 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", + "] d": "editor::GoToDiagnostic", + "[ d": "editor::GoToPrevDiagnostic", + "s s": "outline::Toggle", + "s S": "project_symbols::Toggle" + } + }, + { + "context": "(vim_mode == visual) && !VimWaiting && !menu", + "bindings": { + "shift-j": "editor::MoveLineDown", + "shift-k": "editor::MoveLineUp" + } + }, + { + "context": "Workspace && !vim_mode == insert", + "bindings": {} + }, + { + "context": "OutlinePanel", + "bindings": { + "ctrl-h": ["workspace::ActivatePaneInDirection", "Left"], + "ctrl-l": ["workspace::ActivatePaneInDirection", "Right"], + "ctrl-k": ["workspace::ActivatePaneInDirection", "Up"], + "ctrl-j": ["workspace::ActivatePaneInDirection", "Down"], + "shift-j": "menu::SelectNext", + "shift-k": "menu::SelectPrev" + } + }, + { + "context": "Terminal", + "bindings": { + "ctrl-h": ["workspace::ActivatePaneInDirection", "Left"], + "ctrl-l": ["workspace::ActivatePaneInDirection", "Right"], + "ctrl-k": ["workspace::ActivatePaneInDirection", "Up"], + "ctrl-j": ["workspace::ActivatePaneInDirection", "Down"] + } + }, + { + "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", + // Close project panel as project file panel on the right + "q": "workspace::ToggleRightDock", + "space e": "workspace::ToggleRightDock", + // Navigate between panel + "ctrl-h": ["workspace::ActivatePaneInDirection", "Left"], + "ctrl-l": ["workspace::ActivatePaneInDirection", "Right"], + "ctrl-k": ["workspace::ActivatePaneInDirection", "Up"], + "ctrl-j": ["workspace::ActivatePaneInDirection", "Down"] + } + }, + { + "context": "Dock", + "bindings": { + "ctrl-w h": ["workspace::ActivatePaneInDirection", "Left"], + "ctrl-w l": ["workspace::ActivatePaneInDirection", "Right"], + "ctrl-w k": ["workspace::ActivatePaneInDirection", "Up"], + "ctrl-w j": ["workspace::ActivatePaneInDirection", "Down"] + } + } +] diff --git a/work-laptop/configs/zed/.config/zed/settings.json b/work-laptop/configs/zed/.config/zed/settings.json new file mode 100644 index 0000000..5fc774e --- /dev/null +++ b/work-laptop/configs/zed/.config/zed/settings.json @@ -0,0 +1,119 @@ +// 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 `zed: open default settings` from the +// command palette +{ + // Move all panel to the right + "project_panel": { + "button": true, + "dock": "right", + "git_status": true + }, + "outline_panel": { + "dock": "right" + }, + "collaboration_panel": { + "dock": "left" + }, + // Move some unnecessary panels to the left + "notification_panel": { + "dock": "left" + }, + "chat_panel": { + "dock": "left" + }, + "assistant": { + "default_model": { + "provider": "copilot_chat", + "model": "claude-3-5-sonnet" + }, + "version": "2" + }, + "tab_bar": { + "show": true + }, + "indent_guides": { + "enabled": true, + "coloring": "indent_aware" + }, + "inlay_hints": { + "enabled": true + }, + "languages": { + "TypeScript": { + // Refer https://github.com/jellydn/ts-inlay-hints for how to setup for Neovim and VSCode + "inlay_hints": { + "enabled": true, + "show_parameter_hints": false, + "show_other_hints": true, + "show_type_hints": true + } + }, + "Python": { + "format_on_save": { "language_server": { "name": "ruff" } }, + "formatter": { "language_server": { "name": "ruff" } }, + "language_servers": ["pyright", "ruff"] + } + }, + "lsp": { + "pyright": { + "settings": { + "python.analysis": { + "diagnosticMode": "workspace" + // "typeCheckingMode": "strict" + } + } + } + }, + "file_types": { + "Dockerfile": ["Dockerfile", "Dockerfile.*"], + "JSON": ["json", "jsonc", "*.code-snippets"] + }, + "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" + ], + "telemetry": { + "diagnostics": false, + "metrics": false + }, + "scrollbar": { + "show": "never" + }, + "vim_mode": true, + "relative_line_numbers": true, + "ui_font_size": 16, + "buffer_font_size": 18, + "buffer_font_family": "CartographCF Nerd Font", + "theme": "XY-Zed", + "terminal": { + "detect_venv": { + "on": { + "activate_script": "fish" + } + } + } +}