From 860321f63eed948bbde65d6cf1a194245c43438a Mon Sep 17 00:00:00 2001 From: aleidk Date: Mon, 21 Oct 2024 15:31:46 -0300 Subject: [PATCH] add zed config --- chezmoi/dot_config/zed/keymap.json | 175 +++++++++++++++++++ chezmoi/dot_config/zed/private_settings.json | 63 +++++++ chezmoi/dot_config/zed/themes/.keep | 0 3 files changed, 238 insertions(+) create mode 100644 chezmoi/dot_config/zed/keymap.json create mode 100644 chezmoi/dot_config/zed/private_settings.json create mode 100644 chezmoi/dot_config/zed/themes/.keep diff --git a/chezmoi/dot_config/zed/keymap.json b/chezmoi/dot_config/zed/keymap.json new file mode 100644 index 0000000..0ac6511 --- /dev/null +++ b/chezmoi/dot_config/zed/keymap.json @@ -0,0 +1,175 @@ +[ + { + "context": "Editor && (vim_mode == normal || vim_mode == visual) && !VimWaiting && !menu", + "bindings": { + // Git + + // 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", + + // Chat with AI + "space a c": "assistant::ToggleFocus", + + // Go to file with `gf` + "g f": "editor::OpenExcerpts" + } + }, + { + // move context menus with Ctrl + hjkl in completions + "context": "(vim_mode == normal || vim_mode == insert) && (showing_code_actions || showing_completions)", + "bindings": { + "ctrl-h": "editor::ContextMenuPrev", + "ctrl-j": "editor::ContextMenuNext", + "ctrl-k": "editor::ContextMenuPrev", + "ctrl-l": "editor::ContextMenuNext" + } + }, + { + // move context menus with Ctrl + hjkl in menus + "context": "Picker || menu", + "bindings": { + "ctrl-h": "menu::SelectPrev", + "ctrl-j": "menu::SelectNext", + "ctrl-k": "menu::SelectPrev", + "ctrl-l": "menu::SelectNext" + } + }, + { + "context": "Editor && vim_mode == normal && !VimWaiting && !menu", + "bindings": { + // Window movement bindings + // Ctrl jklk to move between panes + "ctrl-h": ["workspace::ActivatePaneInDirection", "Left"], + "ctrl-l": ["workspace::ActivatePaneInDirection", "Right"], + "ctrl-k": ["workspace::ActivatePaneInDirection", "Up"], + "ctrl-j": ["workspace::ActivatePaneInDirection", "Down"], + + "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::GoToPrevDiagnostic", + + // 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::GoToPrevHunk", + + // + Buffers + // Switch between buffers + "shift-h": "pane::ActivatePrevItem", + "shift-l": "pane::ActivateNextItem", + + // Close active panel + "space b c": "pane::CloseActiveItem", + "space b d": "pane::CloseActiveItem", + // Close other items + "space b o": "pane::CloseInactiveItems", + // 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", + "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", + "space e": "workspace::ToggleLeftDock" + } + }, + { + "context": "Terminal", + "bindings": { + "ctrl-h": ["workspace::ActivatePaneInDirection", "Left"], + "ctrl-l": ["workspace::ActivatePaneInDirection", "Right"], + "ctrl-k": ["workspace::ActivatePaneInDirection", "Up"], + "ctrl-j": ["workspace::ActivatePaneInDirection", "Down"] + } + }, + // 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": "project_panel::CopyRelativePath", + "Y": "project_panel::CopyPath", + "o": ["project_panel::Open", "workspace::toggleLeftDock"], + // Close project panel as project file panel on the right + // Navigate between panel + "ctrl-h": ["workspace::ActivatePaneInDirection", "Left"], + "ctrl-l": ["workspace::ActivatePaneInDirection", "Right"], + "ctrl-k": ["workspace::ActivatePaneInDirection", "Up"], + "ctrl-j": ["workspace::ActivatePaneInDirection", "Down"] + } + }, + // Panel nagivation + { + "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"] + } + } + // Subword motion is not working really nice with `ciw`, disable for now + // { + // "context": "VimControl && !menu", + // "bindings": { + // "w": "vim::NextSubwordStart", + // "b": "vim::PreviousSubwordStart", + // "e": "vim::NextSubwordEnd", + // "g e": "vim::PreviousSubwordEnd" + // } + // } +] diff --git a/chezmoi/dot_config/zed/private_settings.json b/chezmoi/dot_config/zed/private_settings.json new file mode 100644 index 0000000..5b7030a --- /dev/null +++ b/chezmoi/dot_config/zed/private_settings.json @@ -0,0 +1,63 @@ +// 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 (cmd-shift-p / ctrl-shift-p) +{ + "vim_mode": true, + "ui_font_size": 16, + "buffer_font_size": 16, + "buffer_font_family": "JetBrainsMono Nerd Font", + "cursor_blink": true, + "use_multiline_find": true, + "use_smartcase_search": true, + "relative_line_numbers": true, + "scroll_beyond_last_line": "vertical_scroll_margin", + "vertical_scroll_margin": 15, + "theme": { + "mode": "system", + "light": "One Light", + "dark": "Catppuccin Macchiato" + }, + "tab_bar": { + "show": true, + "show_nav_history_buttons": false + }, + "tabs": { + "file_icons": true, + "git_status": true + }, + "git": { + "git_gutter": "tracked_files", + "inline_blame": { + "enabled": false + } + }, + "indent_guides": { + "coloring": "indent_aware" + }, + "terminal": { + "copy_on_select": true, + "button": true + }, + "hover_popover_enabled": true, + "inlay_hints": { + "enabled": true + }, + "preview_tabs": { + "enabled": true, + "enable_preview_from_code_navigation": true, + "enable_preview_from_file_finder": false + }, + "scrollbar": { + "show": "auto", + "cursors": false, + "git_diff": false, + "search_results": true, + "selected_symbol": true, + "diagnostics": true + } +} diff --git a/chezmoi/dot_config/zed/themes/.keep b/chezmoi/dot_config/zed/themes/.keep new file mode 100644 index 0000000..e69de29