mirror of
https://github.com/pratiktri/dotfiles.git
synced 2026-02-04 08:41:43 +05:30
feat(zed): Configure zed ide
- Port over as much Neovim features as possible - Use *almost* the same keymaps as Neovi
This commit is contained in:
@@ -1,33 +1,142 @@
|
|||||||
// 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`
|
// To see the default key bindings run `zed: open default keymap`
|
||||||
// from the command palette.
|
// TODO: Enable spell checking in VIM mode
|
||||||
|
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"context": "Workspace",
|
"context": "Workspace",
|
||||||
"bindings": {
|
"bindings": {
|
||||||
"shift shift": "file_finder::Toggle"
|
"ctrl-/": "journal::NewJournalEntry",
|
||||||
|
"ctrl-1": "project_panel::ToggleFocus",
|
||||||
|
"ctrl-2": "git_panel::ToggleFocus",
|
||||||
|
"ctrl-3": "outline_panel::ToggleFocus",
|
||||||
|
"ctrl-4": "debug_panel::ToggleFocus",
|
||||||
|
"ctrl-5": "notification_panel::ToggleFocus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"context": "( ProjectPanel || GitPanel || OutlinePanel ) && not_editing",
|
||||||
"bindings": {
|
"bindings": {
|
||||||
"ctrl-k z": "workspace::ToggleZoom"
|
"q": "workspace::ToggleLeftDock"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"context": "Workspace",
|
"context": "GitDiff > Editor",
|
||||||
"bindings": {
|
"bindings": {
|
||||||
"ctrl ctrl": "command_palette::Toggle"
|
"s": "git::ToggleStaged",
|
||||||
|
"x": "git::Restore",
|
||||||
|
"c": "git::Commit"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"context": "Editor",
|
"context": "Dock",
|
||||||
"bindings": {
|
"bindings": {
|
||||||
// "j k": ["workspace::SendKeystrokes", "escape"]
|
"ctrl-w h": "workspace::ActivatePaneLeft",
|
||||||
"ctrl-alt-j": "journal::NewJournalEntry"
|
"ctrl-w l": "workspace::ActivatePaneRight",
|
||||||
|
"ctrl-w k": "workspace::ActivatePaneUp",
|
||||||
|
"ctrl-w j": "workspace::ActivatePaneDown"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"context": "Editor && ( vim_mode == visual || vim_mode == normal )&& !VimWaiting && !menu",
|
||||||
|
"bindings": {
|
||||||
|
// Access system clipboard
|
||||||
|
"space p": "editor::Paste",
|
||||||
|
"space y": "editor::Copy"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"context": "Editor && vim_mode == visual && !VimWaiting && !menu",
|
||||||
|
"bindings": {
|
||||||
|
// Move line up/down with J/K
|
||||||
|
"J": "editor::MoveLineDown",
|
||||||
|
"K": "editor::MoveLineUp"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"context": "Editor && vim_mode == normal && !VimWaiting && !menu",
|
||||||
|
"bindings": {
|
||||||
|
// Useful Zed-VIM defaults:
|
||||||
|
// Go to declaration => gD
|
||||||
|
// Go to type definition => gy
|
||||||
|
// Go to implementation => gI
|
||||||
|
// Rename (change definition) => cd
|
||||||
|
// Go to All references to the current word => gA
|
||||||
|
// Find symbol in current file => gs
|
||||||
|
// Find symbol in project => gS
|
||||||
|
// Show inline error (hover) => gh
|
||||||
|
// Open the code actions menu => g.
|
||||||
|
//
|
||||||
|
// Multi-cursor:
|
||||||
|
// Add a cursor selecting the next copy of the current word => gl
|
||||||
|
// Add a visual selection for every copy of the current word => ga
|
||||||
|
// Add a cursor selecting the previous copy of the current word => gL
|
||||||
|
// Skip latest word selection, and add next => g>
|
||||||
|
// Skip latest word selection, and add previous => g<
|
||||||
|
// After multi-selection: (in VIM as well)
|
||||||
|
// - `A` to append text after the selection
|
||||||
|
// - `I` to insert text before the selection
|
||||||
|
//
|
||||||
|
// https://github.com/tommcdo/vim-exchange
|
||||||
|
// https://github.com/jeetsukumaran/vim-indentwise
|
||||||
|
|
||||||
|
"space tab": "project_panel::ToggleFocus",
|
||||||
|
"space / /": "journal::NewJournalEntry",
|
||||||
|
|
||||||
|
// Coding & Code Navigation
|
||||||
|
"] ]": "vim::MoveToNext",
|
||||||
|
"[ [": "vim::MoveToPrevious",
|
||||||
|
"F2": "editor::Rename",
|
||||||
|
"space r": "editor::Rename",
|
||||||
|
"space c r": "editor::FindAllReferences",
|
||||||
|
"space o": "outline::Toggle",
|
||||||
|
"space O": "project_symbols::Toggle",
|
||||||
|
"ctrl-.": "editor::ToggleCodeActions",
|
||||||
|
"space j": "vim::PushSneak",
|
||||||
|
"space J": "vim::PushSneakBackward",
|
||||||
|
|
||||||
|
// Diagnostics
|
||||||
|
"space d w": "diagnostics::Deploy",
|
||||||
|
"space d t": "editor::ToggleInlineDiagnostics",
|
||||||
|
"space x x": "workspace::SuppressNotification",
|
||||||
|
|
||||||
|
// Git
|
||||||
|
"space g g": "git::Diff",
|
||||||
|
"space g p": "editor::ToggleSelectedDiffHunks",
|
||||||
|
"] g": "editor::GoToHunk",
|
||||||
|
"[ g": "editor::GoToPreviousHunk",
|
||||||
|
"space g s": "git::ToggleStaged",
|
||||||
|
"space g r": "git::Restore",
|
||||||
|
"space g b": "git::Branch",
|
||||||
|
"space g B": "editor::ToggleGitBlameInline",
|
||||||
|
|
||||||
|
// Buffer
|
||||||
|
"space b l": "tab_switcher::ToggleAll",
|
||||||
|
"space b x": "pane::CloseActiveItem",
|
||||||
|
"space x b": "pane::CloseActiveItem",
|
||||||
|
"space x o": "pane::CloseInactiveItems",
|
||||||
|
|
||||||
|
// Quality of life improvements:
|
||||||
|
// Center the cursor when moving through document
|
||||||
|
"ctrl-d": ["workspace::SendKeystrokes", "Ctrl-d z z"],
|
||||||
|
"ctrl-u": ["workspace::SendKeystrokes", "Ctrl-u z z"],
|
||||||
|
"ctrl-o": ["workspace::SendKeystrokes", "Ctrl-o z z"],
|
||||||
|
"ctrl-i": ["workspace::SendKeystrokes", "Ctrl-i z z"],
|
||||||
|
"g ;": ["workspace::SendKeystrokes", "g ; z z"],
|
||||||
|
"g ,": ["workspace::SendKeystrokes", "g , z z"],
|
||||||
|
"] s": ["workspace::SendKeystrokes", "] s z z"],
|
||||||
|
"] d": ["workspace::SendKeystrokes", "] d z z"],
|
||||||
|
"n": ["workspace::SendKeystrokes", "n z z"],
|
||||||
|
"N": ["workspace::SendKeystrokes", "N z z"],
|
||||||
|
//
|
||||||
|
// Better split management
|
||||||
|
"ctrl-j": ["workspace::SendKeystrokes", "ctrl-w j"],
|
||||||
|
"ctrl-k": ["workspace::SendKeystrokes", "ctrl-w k"],
|
||||||
|
"ctrl-h": ["workspace::SendKeystrokes", "ctrl-w h"],
|
||||||
|
"ctrl-l": ["workspace::SendKeystrokes", "ctrl-w l"],
|
||||||
|
"ctrl-up": ["workspace::SendKeystrokes", "ctrl-w +"],
|
||||||
|
"ctrl-down": ["workspace::SendKeystrokes", "ctrl-w -"],
|
||||||
|
"ctrl-right": ["workspace::SendKeystrokes", "ctrl-w >"],
|
||||||
|
"ctrl-left": ["workspace::SendKeystrokes", "ctrl-w <"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,95 +1,129 @@
|
|||||||
// 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
|
// To see all of Zed's default settings without changing your
|
||||||
// custom settings, run `zed: open default settings` from the
|
// custom settings, run `zed: open default settings` from the
|
||||||
// command palette (cmd-shift-p / ctrl-shift-p)
|
// command palette
|
||||||
|
|
||||||
{
|
{
|
||||||
|
"auto_update_extensions": {
|
||||||
|
"proto": false,
|
||||||
|
"rainbow-csv": false,
|
||||||
|
"graphql": false,
|
||||||
|
"csharp": false,
|
||||||
|
"lua": false,
|
||||||
|
"dockerfile": false,
|
||||||
|
"html": false,
|
||||||
|
"catppuccin": false
|
||||||
|
},
|
||||||
|
"auto_install_extensions": {
|
||||||
|
"catppuccin": true,
|
||||||
|
"catppuccin icons": true,
|
||||||
|
"html": true,
|
||||||
|
"dockerfile": true
|
||||||
|
},
|
||||||
"telemetry": { "diagnostics": false, "metrics": false },
|
"telemetry": { "diagnostics": false, "metrics": false },
|
||||||
"assistant": {
|
|
||||||
"default_model": {
|
|
||||||
"provider": "zed.dev",
|
|
||||||
"model": "claude-3-5-sonnet-latest"
|
|
||||||
},
|
|
||||||
"version": "2"
|
|
||||||
},
|
|
||||||
"features": {
|
|
||||||
"inline_completion_provider": "none"
|
|
||||||
},
|
|
||||||
|
|
||||||
"base_keymap": "VSCode",
|
|
||||||
"vim_mode": true,
|
|
||||||
|
|
||||||
|
// UI
|
||||||
|
"theme": {
|
||||||
|
"mode": "dark",
|
||||||
|
"light": "One Light",
|
||||||
|
"dark": "Catppuccin Mocha"
|
||||||
|
},
|
||||||
|
"icon_theme": "Catppuccin Latte",
|
||||||
|
"tabs": { "file_icons": true, "git_status": true },
|
||||||
|
"tab_bar": { "show_nav_history_buttons": false },
|
||||||
"ui_font_size": 16,
|
"ui_font_size": 16,
|
||||||
"buffer_font_size": 18,
|
"buffer_font_size": 18,
|
||||||
"buffer_font_family": "FuraCode Nerd Font",
|
"buffer_font_family": "FuraCode Nerd Font",
|
||||||
"buffer_line_height": { "custom": 1.5 },
|
"agent_font_size": 28,
|
||||||
"tabs": {
|
|
||||||
"file_icons": true,
|
|
||||||
"git_status": true
|
|
||||||
},
|
|
||||||
"outline_panel": {
|
|
||||||
"indent_size": 15,
|
|
||||||
"scrollbar": {
|
|
||||||
"show": "auto"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"project_panel": {
|
|
||||||
"indent_size": 15,
|
|
||||||
"scrollbar": {
|
|
||||||
"show": "auto"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
"terminal": {
|
"terminal": {
|
||||||
"font_family": "FuraCode Nerd Font",
|
"font_family": "FuraCode Nerd Font",
|
||||||
"font_size": 18,
|
"font_size": 18,
|
||||||
"copy_on_select": true
|
"copy_on_select": true,
|
||||||
|
"button": true,
|
||||||
|
"scrollbar": { "show": "auto" },
|
||||||
|
"toolbar": { "breadcrumbs": true }
|
||||||
},
|
},
|
||||||
|
"outline_panel": {
|
||||||
|
"indent_size": 15,
|
||||||
|
"scrollbar": { "show": "auto" }
|
||||||
|
},
|
||||||
|
"project_panel": {
|
||||||
|
"indent_size": 15,
|
||||||
|
"show_diagnostics": "all",
|
||||||
|
"scrollbar": { "show": "auto" }
|
||||||
|
},
|
||||||
|
"collaboration_panel": { "button": false },
|
||||||
|
"bottom_dock_layout": "right_aligned",
|
||||||
|
"file_finder": { "modal_max_width": "small" },
|
||||||
|
"use_smartcase_search": true,
|
||||||
|
"title_bar": { "show_branch_icon": true },
|
||||||
|
|
||||||
// "show_whitespaces": "boundary",
|
// Editor
|
||||||
"soft_wrap": "editor_width",
|
"vim_mode": true,
|
||||||
|
"vim": {
|
||||||
|
"use_system_clipboard": "never",
|
||||||
|
"toggle_relative_line_numbers": true
|
||||||
|
},
|
||||||
|
"vertical_scroll_margin": 10,
|
||||||
|
"base_keymap": "VSCode",
|
||||||
|
"buffer_line_height": { "custom": 1.4 },
|
||||||
"tab_size": 4,
|
"tab_size": 4,
|
||||||
"unnecessary_code_fade": 0.5,
|
"soft_wrap": "editor_width",
|
||||||
|
"autosave": { "after_delay": { "milliseconds": 5000 } },
|
||||||
|
"format_on_save": "on",
|
||||||
|
"unnecessary_code_fade": 0.6,
|
||||||
|
"inlay_hints": {
|
||||||
|
"enabled": true,
|
||||||
|
"show_parameter_hints": true,
|
||||||
|
"show_type_hints": true,
|
||||||
|
"show_other_hints": true,
|
||||||
|
"show_background": true,
|
||||||
|
"show_value_hints": true
|
||||||
|
},
|
||||||
|
"scrollbar": {
|
||||||
|
"git_diff": false
|
||||||
|
},
|
||||||
|
"indent_guides": { "enabled": true },
|
||||||
|
"gutter": {
|
||||||
|
"runnables": true,
|
||||||
|
"min_line_number_digits": 2,
|
||||||
|
"breakpoints": true
|
||||||
|
},
|
||||||
|
"journal": { "path": "~/Code/", "hour_format": "hour24" },
|
||||||
|
"diagnostics": {
|
||||||
|
"inline": {
|
||||||
|
"enabled": false,
|
||||||
|
"update_debounce_ms": 150,
|
||||||
|
"max_severity": "hint"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// "file_scan_exclusions": [ ], // Files that Zed won't search
|
||||||
|
|
||||||
|
// Git
|
||||||
"git": {
|
"git": {
|
||||||
"git_gutter": "tracked_files",
|
"git_gutter": "tracked_files",
|
||||||
"gutter_debounce": null,
|
|
||||||
"inline_blame": {
|
"inline_blame": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"delay_ms": 500
|
"show_commit_summary": true,
|
||||||
|
"delay_ms": 500,
|
||||||
|
"min_column": 80
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
"inlay_hints": {
|
// AI
|
||||||
"enabled": true
|
"agent": {
|
||||||
|
"default_profile": "ask",
|
||||||
|
"default_model": {
|
||||||
|
"provider": "zed.dev",
|
||||||
|
"model": "claude-sonnet-4"
|
||||||
|
},
|
||||||
|
"model_parameters": [],
|
||||||
|
"notify_when_agent_waiting": "all_screens"
|
||||||
},
|
},
|
||||||
|
"edit_predictions_disabled_in": ["markdown"],
|
||||||
|
|
||||||
"journal": {
|
// LSP
|
||||||
"path": "~/Code/",
|
"languages": {
|
||||||
"hour_format": "hour24"
|
"Markdown": {
|
||||||
},
|
"show_edit_predictions": false
|
||||||
|
}
|
||||||
"file_types": {
|
|
||||||
"Shell": ["sh", "bash", "zsh"]
|
|
||||||
},
|
|
||||||
|
|
||||||
// "lsp": {
|
|
||||||
// "rust-analyzer": {
|
|
||||||
// "initialization_options": {
|
|
||||||
// "check": {
|
|
||||||
// "command": "clippy"
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
|
|
||||||
"theme": {
|
|
||||||
"mode": "system",
|
|
||||||
"light": "One Light",
|
|
||||||
"dark": "Catppuccin Mocha"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user