mirror of
https://github.com/pratiktri/dotfiles.git
synced 2026-03-22 04:35:47 +05:30
fix(zed): Keymap and config fixes
This commit is contained in:
@@ -1,24 +1,31 @@
|
||||
// To see the default key bindings run `zed: open default keymap`
|
||||
// TODO: Enable spell checking in VIM mode
|
||||
// FIX: ctrl+n & ctrl+p selections don't work on terminal: cause they are hijacked by IDE
|
||||
// - Use them to select next & previous
|
||||
|
||||
// TIP: To see the default key bindings run `zed: open default keymap`
|
||||
// ISSUES:
|
||||
// - Bash support: buffer symbol search doesn't work
|
||||
// - Git: Not nearly as useful as Neovim > Gitsigns
|
||||
// TODO:
|
||||
// - Git stage multi-buffer: reduce the file name ribbon size
|
||||
// - AI:
|
||||
// - Set shortcuts:
|
||||
// - Toggle left panel
|
||||
// - Increase/Decrease panel size
|
||||
[
|
||||
{
|
||||
"context": "Workspace",
|
||||
"context": "Workspace && vim_mode == normal",
|
||||
"bindings": {
|
||||
"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"
|
||||
"ctrl-5": "notification_panel::ToggleFocus",
|
||||
"space tab": "workspace::ToggleLeftDock"
|
||||
}
|
||||
},
|
||||
{
|
||||
"context": "( ProjectPanel || GitPanel || OutlinePanel ) && not_editing",
|
||||
"context": "ProjectPanel && not_editing",
|
||||
"bindings": {
|
||||
"q": "workspace::ToggleLeftDock"
|
||||
"q": "workspace::ToggleLeftDock",
|
||||
"space tab": "workspace::ToggleLeftDock"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -39,7 +46,42 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"context": "Editor && ( vim_mode == visual || vim_mode == normal )&& !VimWaiting && !menu",
|
||||
"context": "Picker",
|
||||
"bindings": {
|
||||
"ctrl-[": "menu::Cancel"
|
||||
}
|
||||
},
|
||||
{
|
||||
"context": "BufferSearchBar",
|
||||
"bindings": {
|
||||
"ctrl-[": "buffer_search::Dismiss"
|
||||
}
|
||||
},
|
||||
{
|
||||
"context": "ProjectSearchBar",
|
||||
"bindings": {
|
||||
"ctrl-[": "project_search::ToggleFocus"
|
||||
}
|
||||
},
|
||||
{
|
||||
"context": "Terminal",
|
||||
"bindings": {
|
||||
// Don't let ctrl-p & ctrl-n be high jacked
|
||||
"ctrl-p": [
|
||||
"terminal::SendKeystroke",
|
||||
"ctrl-p"
|
||||
],
|
||||
"ctrl-n": [
|
||||
"terminal::SendKeystroke",
|
||||
"ctrl-n"
|
||||
],
|
||||
"ctrl-shift-up": "workspace::IncreaseActiveDockSize",
|
||||
"ctrl-shift-down": "workspace::DecreaseActiveDockSize",
|
||||
"ctrl-shift-enter": "workspace::NewTerminal"
|
||||
}
|
||||
},
|
||||
{
|
||||
"context": "Editor && ( vim_mode == visual || vim_mode == normal )",
|
||||
"bindings": {
|
||||
// Access system clipboard
|
||||
"space p": "editor::Paste",
|
||||
@@ -47,7 +89,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"context": "Editor && vim_mode == visual && !VimWaiting && !menu",
|
||||
"context": "Editor && vim_mode == visual",
|
||||
"bindings": {
|
||||
// Move line up/down with J/K
|
||||
"J": "editor::MoveLineDown",
|
||||
@@ -55,7 +97,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"context": "Editor && vim_mode == normal && !VimWaiting && !menu",
|
||||
"context": "Editor && vim_mode == normal",
|
||||
"bindings": {
|
||||
// Useful Zed-VIM defaults:
|
||||
// Go to declaration => gD
|
||||
@@ -74,9 +116,6 @@
|
||||
// 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
|
||||
@@ -84,27 +123,30 @@
|
||||
// AI:
|
||||
// Accept edit-prediction on Linux => alt-l
|
||||
// Accept next predicted word => alt-right
|
||||
|
||||
"space tab": "project_panel::ToggleFocus",
|
||||
"space / /": "journal::NewJournalEntry",
|
||||
|
||||
"ctrl-escape": "workspace::ToggleCenteredLayout",
|
||||
// Coding & Code Navigation
|
||||
"] ]": "vim::MoveToNext",
|
||||
"[ [": "vim::MoveToPrevious",
|
||||
"] ]": "vim::GoToNextReference",
|
||||
"[ [": "vim::GoToPreviousReference",
|
||||
"] f": "vim::NextMethodStart",
|
||||
"[ f": "vim::PreviousMethodStart",
|
||||
"] i": "vim::NextSameIndent",
|
||||
"[ i": "vim::PreviousSameIndent",
|
||||
"] C": "vim::NextSectionStart",
|
||||
"[ C": "vim::PreviousSectionStart",
|
||||
"ctrl-space": "editor::SelectLargerSyntaxNode",
|
||||
"F2": "editor::Rename",
|
||||
"space r": "editor::Rename",
|
||||
"space c r": "editor::FindAllReferences",
|
||||
"space o": "outline::Toggle",
|
||||
"space O": "project_symbols::Toggle",
|
||||
"space s": "outline::Toggle",
|
||||
"space S": "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",
|
||||
@@ -114,35 +156,80 @@
|
||||
"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",
|
||||
|
||||
"space x o": "pane::CloseOtherItems",
|
||||
"space b p": "pane::TogglePinTab",
|
||||
// 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"],
|
||||
"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"
|
||||
],
|
||||
"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 <"]
|
||||
"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 <"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -2,6 +2,40 @@
|
||||
// custom settings, run `zed: open default settings` from the
|
||||
// command palette
|
||||
{
|
||||
"show_edit_predictions": false,
|
||||
"edit_predictions": {
|
||||
"mode": "subtle"
|
||||
},
|
||||
"disable_ai": false,
|
||||
"completion_menu_scrollbar": "auto",
|
||||
"show_whitespaces": "trailing",
|
||||
"toolbar": {
|
||||
"code_actions": false
|
||||
},
|
||||
"relative_line_numbers": "enabled",
|
||||
"prettier": {
|
||||
"allowed": false
|
||||
},
|
||||
"search": {
|
||||
"center_on_match": true,
|
||||
"regex": true
|
||||
},
|
||||
"window_decorations": "client",
|
||||
"use_system_window_tabs": false,
|
||||
"preview_tabs": {
|
||||
"enable_preview_multibuffer_from_code_navigation": false,
|
||||
"enable_preview_from_project_panel": true,
|
||||
"enable_preview_from_file_finder": true
|
||||
},
|
||||
"status_bar": {
|
||||
"cursor_position_button": true,
|
||||
"active_language_button": true
|
||||
},
|
||||
"git_panel": {
|
||||
"collapse_untracked_diff": false,
|
||||
"status_style": "label_color",
|
||||
"default_width": 240.0
|
||||
},
|
||||
"auto_update_extensions": {
|
||||
"proto": false,
|
||||
"rainbow-csv": false,
|
||||
@@ -16,17 +50,27 @@
|
||||
"html": true,
|
||||
"dockerfile": true
|
||||
},
|
||||
"telemetry": { "diagnostics": false, "metrics": false },
|
||||
|
||||
"telemetry": {
|
||||
"diagnostics": false,
|
||||
"metrics": false
|
||||
},
|
||||
// UI
|
||||
"theme": {
|
||||
"mode": "dark",
|
||||
"light": "One Light",
|
||||
"dark": "Github Dark Dimmed"
|
||||
},
|
||||
"icon_theme": "Modern Icons (Dark)",
|
||||
"tabs": { "file_icons": true, "git_status": true },
|
||||
"tab_bar": { "show_nav_history_buttons": false },
|
||||
"icon_theme": "Material Icon Theme",
|
||||
"tabs": {
|
||||
"show_close_button": "always",
|
||||
"show_diagnostics": "off",
|
||||
"file_icons": true,
|
||||
"git_status": true
|
||||
},
|
||||
"tab_bar": {
|
||||
"show_tab_bar_buttons": true,
|
||||
"show_nav_history_buttons": false
|
||||
},
|
||||
"ui_font_size": 17,
|
||||
"buffer_font_size": 18,
|
||||
"buffer_font_family": "MonoLisa",
|
||||
@@ -41,30 +85,59 @@
|
||||
"ss17": true,
|
||||
"ss18": true
|
||||
},
|
||||
"agent_font_size": 18,
|
||||
"agent_ui_font_size": 19,
|
||||
"agent_buffer_font_size": 17,
|
||||
"terminal": {
|
||||
"font_family": "MonoLisa",
|
||||
"font_size": 18,
|
||||
"copy_on_select": true,
|
||||
"button": true,
|
||||
"scrollbar": { "show": "auto" },
|
||||
"toolbar": { "breadcrumbs": true }
|
||||
"scrollbar": {
|
||||
"show": "auto"
|
||||
},
|
||||
"toolbar": {
|
||||
"breadcrumbs": true
|
||||
}
|
||||
},
|
||||
"outline_panel": {
|
||||
"indent_size": 15,
|
||||
"scrollbar": { "show": "auto" }
|
||||
"git_status": false,
|
||||
"default_width": 240.0,
|
||||
"button": true,
|
||||
"indent_size": 18.0,
|
||||
"scrollbar": {
|
||||
"show": "auto"
|
||||
}
|
||||
},
|
||||
"project_panel": {
|
||||
"indent_size": 15,
|
||||
"button": true,
|
||||
"hide_hidden": false,
|
||||
"hide_root": true,
|
||||
"git_status": true,
|
||||
"folder_icons": false,
|
||||
"file_icons": true,
|
||||
"entry_spacing": "standard",
|
||||
"indent_size": 18.0,
|
||||
"show_diagnostics": "all",
|
||||
"scrollbar": { "show": "auto" }
|
||||
"scrollbar": {
|
||||
"show": "auto"
|
||||
}
|
||||
},
|
||||
"collaboration_panel": {
|
||||
"button": false
|
||||
},
|
||||
"collaboration_panel": { "button": false },
|
||||
"bottom_dock_layout": "right_aligned",
|
||||
"file_finder": { "modal_max_width": "small" },
|
||||
"file_finder": {
|
||||
"modal_max_width": "small"
|
||||
},
|
||||
"use_smartcase_search": true,
|
||||
"title_bar": { "show_branch_icon": true },
|
||||
|
||||
"title_bar": {
|
||||
"show_menus": false,
|
||||
"show_user_picture": false,
|
||||
"show_onboarding_banner": true,
|
||||
"show_project_items": true,
|
||||
"show_branch_name": true,
|
||||
"show_branch_icon": true
|
||||
},
|
||||
// Editor
|
||||
"vim_mode": true,
|
||||
"vim": {
|
||||
@@ -73,10 +146,16 @@
|
||||
},
|
||||
"vertical_scroll_margin": 10,
|
||||
"base_keymap": "VSCode",
|
||||
"buffer_line_height": { "custom": 1.4 },
|
||||
"buffer_line_height": {
|
||||
"custom": 1.4
|
||||
},
|
||||
"tab_size": 4,
|
||||
"soft_wrap": "editor_width",
|
||||
"autosave": { "after_delay": { "milliseconds": 5000 } },
|
||||
"autosave": {
|
||||
"after_delay": {
|
||||
"milliseconds": 2000
|
||||
}
|
||||
},
|
||||
"format_on_save": "on",
|
||||
"unnecessary_code_fade": 0.6,
|
||||
"inlay_hints": {
|
||||
@@ -88,15 +167,22 @@
|
||||
"show_value_hints": true
|
||||
},
|
||||
"scrollbar": {
|
||||
"cursors": true,
|
||||
"git_diff": false
|
||||
},
|
||||
"indent_guides": { "enabled": true },
|
||||
"indent_guides": {
|
||||
"coloring": "fixed",
|
||||
"enabled": true
|
||||
},
|
||||
"gutter": {
|
||||
"runnables": true,
|
||||
"min_line_number_digits": 2,
|
||||
"breakpoints": true
|
||||
},
|
||||
"journal": { "path": "~/Code/", "hour_format": "hour24" },
|
||||
"journal": {
|
||||
"path": "~/Code/",
|
||||
"hour_format": "hour24"
|
||||
},
|
||||
"diagnostics": {
|
||||
"inline": {
|
||||
"enabled": false,
|
||||
@@ -105,7 +191,6 @@
|
||||
}
|
||||
},
|
||||
// "file_scan_exclusions": [ ], // Files that Zed won't search
|
||||
|
||||
// Git
|
||||
"git": {
|
||||
"git_gutter": "tracked_files",
|
||||
@@ -116,26 +201,21 @@
|
||||
"min_column": 80
|
||||
}
|
||||
},
|
||||
|
||||
// AI
|
||||
"agent": {
|
||||
"default_profile": "write",
|
||||
"default_model": {
|
||||
"provider": "lmstudio",
|
||||
"model": "unsloth/gpt-oss-20b"
|
||||
},
|
||||
"use_modifier_to_send": true,
|
||||
"enable_feedback": false,
|
||||
"default_profile": "ask",
|
||||
"model_parameters": [],
|
||||
"notify_when_agent_waiting": "all_screens"
|
||||
"notify_when_agent_waiting": "never"
|
||||
},
|
||||
"edit_predictions_disabled_in": ["markdown"],
|
||||
|
||||
// LSP
|
||||
"languages": {
|
||||
"Markdown": {
|
||||
"show_edit_predictions": false
|
||||
}
|
||||
},
|
||||
|
||||
"lsp": {
|
||||
"rust-analyzer": {
|
||||
"initialization_options": {
|
||||
|
||||
Reference in New Issue
Block a user