From 9146c7f72bfceb29b036a173a111df646b65da92 Mon Sep 17 00:00:00 2001 From: SepehrYahyaee <7heycallmegray@gmail.com> Date: Tue, 19 May 2026 11:15:45 +0330 Subject: [PATCH] Added Corrected Zed keymaps and settings and themes --- ZED/keymap.json | 342 +++++++++++++++++++++++++++++++++ ZED/settings.json | 52 +++++ ZED/themes/forsakenknight.json | 256 ++++++++++++++++++++++++ 3 files changed, 650 insertions(+) create mode 100644 ZED/keymap.json create mode 100644 ZED/settings.json create mode 100644 ZED/themes/forsakenknight.json diff --git a/ZED/keymap.json b/ZED/keymap.json new file mode 100644 index 0000000..b1c3ca4 --- /dev/null +++ b/ZED/keymap.json @@ -0,0 +1,342 @@ +// Zed keymap — WASD-style vim bindings +// Mirrors keymaps.lua for Neovim. +// +// Key remapping legend (nvim lhs → nvim rhs → Zed action): +// Movement : w→k s→j a→h d→l +// Word fwd : i→w I→W j→e J→E +// Word back : (b/B unchanged) +// Insert : e→i E→a A→I D→A +// Delete op : r→d R→D +// Substitute: f→s F→S +// Replace : t→r T→R +// Open line : W→O S→o +// Visual : h→v H→V +// Find fwd : l→f L→F +// Till fwd : p→t P→T +// Paste : v→p V→P +// Nop'd : k K O (collisions cleared) +// +// Place this file at: +// macOS : ~/.config/zed/keymap.json +// Linux : ~/.config/zed/keymap.json +// Windows: %APPDATA%\Zed\keymap.json + +[ + // ───────────────────────────────────────────────────────────── + // NORMAL MODE + // ───────────────────────────────────────────────────────────── + { + "context": "vim_mode == normal && !menu", + "bindings": { + // ── Movement (WASD) ────────────────────────────────────── + "w": "vim::Up", + "s": "vim::Down", + "a": "vim::Left", + "d": "vim::Right", + + // ── Word motions ───────────────────────────────────────── + // i → w (next word start), I → W (WORD) + "i": "vim::NextWordStart", + "I": ["vim::NextWordStart", { "ignore_punctuation": true }], + // j → e (next word end), J → E (WORD end) + "j": "vim::NextWordEnd", + "J": ["vim::NextWordEnd", { "ignore_punctuation": true }], + // b / B unchanged (previous word start) + + // ── Enter insert mode ──────────────────────────────────── + "e": "vim::InsertBefore", // e → i + "E": "vim::InsertAfter", // E → a + "A": "vim::InsertFirstNonWhitespace", // A → I + "D": "vim::InsertEndOfLine", // D → A + + // ── Open lines ─────────────────────────────────────────── + "S": "vim::InsertLineBelow", // S → o + "W": "vim::InsertLineAbove", // W → O + + // ── Delete operator ────────────────────────────────────── + // r → d (push delete, waits for motion/object) + "r": "vim::PushDelete", + // R → D (delete to end of line) + "R": "vim::DeleteToEndOfLine", + + // ── Change / substitute ────────────────────────────────── + // c unchanged (push change operator) + // f → s (substitute character under cursor, i.e. vim 's') + "f": "vim::Substitute", + // F → S (substitute whole line) + "F": "vim::SubstituteLine", + + // ── Replace (single char) ──────────────────────────────── + // t → r (push replace — waits for char) + "t": "vim::PushReplace", + // T → R (toggle replace mode) + "T": "vim::ToggleReplace", + + // ── Visual mode entry ──────────────────────────────────── + "h": "vim::ToggleVisual", // h → v + "H": "vim::ToggleVisualLine", // H → V + + // ── Find / till ────────────────────────────────────────── + // l → f (find forward) + "l": [ + "vim::PushFindForward", + { "before": false, "multiline": false }, + ], + // L → F (find backward) + "L": [ + "vim::PushFindBackward", + { "after": false, "multiline": false }, + ], + // p → t (till forward, stops before char) + "p": [ + "vim::PushFindForward", + { "before": true, "multiline": false }, + ], + // P → T (till backward) + "P": [ + "vim::PushFindBackward", + { "after": true, "multiline": false }, + ], + + // ── Paste ──────────────────────────────────────────────── + "v": "vim::Paste", // v → p + "V": ["vim::Paste", { "before": true }], // V → P + + // ── Nop — clear dangerous collisions ──────────────────── + "k": null, + "K": null, + "o": null, + "O": null, + + // ── Repeat find (unchanged) ────────────────────────────── + ";": "vim::RepeatFind", + ",": "vim::RepeatFindReversed", + }, + }, + + // ───────────────────────────────────────────────────────────── + // VISUAL MODE + // ───────────────────────────────────────────────────────────── + { + "context": "vim_mode == visual && !menu", + "bindings": { + // ── Movement ───────────────────────────────────────────── + "w": "vim::Up", + "s": "vim::Down", + "a": ["vim::PushObject", { "around": true }], // 'a' text-object prefix kept + "d": "vim::Right", + + // ── Word motions ───────────────────────────────────────── + "i": ["vim::PushObject", { "around": false }], // 'i' text-object prefix kept in visual + "I": ["vim::NextWordStart", { "ignore_punctuation": true }], + "j": "vim::NextWordEnd", + "J": ["vim::NextWordEnd", { "ignore_punctuation": true }], + + // ── Operators ──────────────────────────────────────────── + "r": "vim::VisualDelete", // r → d (delete selection) + "R": "vim::VisualDeleteLine", // R → D + "f": "vim::Substitute", // f → s (substitute selection) + "F": "vim::SubstituteLine", // F → S + + // ── Replace char in selection ──────────────────────────── + "t": "vim::PushReplace", + + // ── Paste ──────────────────────────────────────────────── + "v": "vim::Paste", + "V": ["vim::Paste", { "preserve_clipboard": true }], + + // ── Find / till ────────────────────────────────────────── + "l": [ + "vim::PushFindForward", + { "before": false, "multiline": false }, + ], + "L": [ + "vim::PushFindBackward", + { "after": false, "multiline": false }, + ], + "p": [ + "vim::PushFindForward", + { "before": true, "multiline": false }, + ], + "P": [ + "vim::PushFindBackward", + { "after": true, "multiline": false }, + ], + + // ── Nop ────────────────────────────────────────────────── + "k": null, + "K": null, + "O": null, + + // ── Repeat find ────────────────────────────────────────── + ";": "vim::RepeatFind", + ",": "vim::RepeatFindReversed", + }, + }, + + // ───────────────────────────────────────────────────────────── + // OPERATOR-PENDING MODE + // Entered after pressing an operator (r=d, c, y, etc.). + // Zed evaluates BOTH vim_mode==operator bindings AND + // vim_operator==X bindings simultaneously, most-specific wins. + // + // CRITICAL: 'a' and 'i' must NOT be movement keys here — + // they need to push the text-object context so that sequences + // like "rai" (daw) and "cai" (caw) work correctly. + // 'd' (right) is safe because it doesn't clash with any object prefix. + // 's' (down) is safe for counts: r2s = delete 2 lines down. + // ───────────────────────────────────────────────────────────── + { + "context": "vim_mode == operator && !menu", + "bindings": { + // ── Movement motions ───────────────────────────────────── + "w": "vim::Up", + "s": "vim::Down", + // NOTE: 'a' is intentionally OMITTED here — left to the + // default vim binding so it acts as PushObject {around:true}, + // enabling "ra", "ca" chains. + // NOTE: 'i' is intentionally OMITTED here — same reason, + // so "ri", "ci" chains work. + "d": "vim::Right", + + // ── Word motions (your i→w, j→e remaps) ───────────────── + // These only fire when NOT immediately followed by an object key. + // Zed resolves ambiguity by waiting for the next key: + // "ri" → i pushes object context (PushObject inner) → wait for obj key + // "rij" → i pushes object context → j=NextWordEnd (word end object? no — + // j in object context = vim::NextWordEnd motion, acts as object) + // So we put word motions on i/j only in contexts where they're unambiguous: + // We handle this via the object-context layer below instead. + + // ── Nop ────────────────────────────────────────────────── + "k": null, + "K": null, + + // ── Find / till motions ────────────────────────────────── + "l": [ + "vim::PushFindForward", + { "before": false, "multiline": false }, + ], + "L": [ + "vim::PushFindBackward", + { "after": false, "multiline": false }, + ], + "p": [ + "vim::PushFindForward", + { "before": true, "multiline": false }, + ], + "P": [ + "vim::PushFindBackward", + { "after": true, "multiline": false }, + ], + + // ── Repeat find ────────────────────────────────────────── + ";": "vim::RepeatFind", + ",": "vim::RepeatFindReversed", + }, + }, + + // ───────────────────────────────────────────────────────────── + // TEXT OBJECTS (vim_operator == a or vim_operator == i) + // Entered after pressing 'a' (around) or 'i' (inner) in operator mode. + // + // Your nvim remaps (operator-pending): + // i → w so "ci" = change inner word (vanilla: "cw" but really "ciw") + // ai → aw so "cai" = change a word (vanilla: "caw") + // ai → aw so "rai" = delete a word (vanilla: "daw") + // + // In Zed: after 'a' prefix → vim_operator == a → next key selects object + // after 'i' prefix → vim_operator == i → next key selects object + // + // Key remaps inside object context: + // i → Word (your word key, so "cii"=inner word, "cai"=a word) + // j → NextWordEnd used as object? No — j maps to vim::Word for end-of-word obj + // s → Sentence (s was your Down, but inside obj context it's unambiguous) + // w → Word (vanilla fallback) + // d → Right motion doesn't make sense as object, leave as Right? No — + // inside obj context all keys are object names, not motions. + // 'd' has no standard vim text object so leave unmapped / null. + // ───────────────────────────────────────────────────────────── + { + "context": "vim_operator == a || vim_operator == i || vim_operator == cs || vim_operator == helix_next || vim_operator == helix_previous", + "bindings": { + // ── Your remapped word keys → word objects ──────────────── + "i": "vim::Word", // cai / cii / rai / rii → word + "I": ["vim::Word", { "ignore_punctuation": true }], // caI / ciI → WORD + + // ── Standard object keys (vanilla vim, kept as-is) ──────── + "w": "vim::Word", + "s": "vim::Sentence", // s=Sentence (not Down here) + "p": "vim::Paragraph", + "t": "vim::Tag", + "e": "vim::EntireFile", + "f": "vim::Method", + "c": "vim::Class", + "a": "vim::Argument", // 'a' = Argument object (e.g. "cia") + "\"": "vim::DoubleQuotes", + "'": "vim::Quotes", + "`": "vim::BackQuotes", + "q": "vim::MiniQuotes", + "|": "vim::VerticalBars", + "(": ["vim::Parentheses", { "opening": true }], + ")": "vim::Parentheses", + "b": "vim::Parentheses", + "[": ["vim::SquareBrackets", { "opening": true }], + "]": "vim::SquareBrackets", + "r": "vim::SquareBrackets", // 'r' = [] object (inside obj ctx) + "{": ["vim::CurlyBrackets", { "opening": true }], + "}": "vim::CurlyBrackets", + "B": "vim::CurlyBrackets", + "<": ["vim::AngleBrackets", { "opening": true }], + ">": "vim::AngleBrackets", + }, + }, + + // ───────────────────────────────────────────────────────────── + // DELETE OPERATOR (after pressing r) + // r→d, so vim_operator == d fires. We need "rr" → dd (current line). + // ───────────────────────────────────────────────────────────── + { + "context": "vim_operator == d", + "bindings": { + "r": "vim::CurrentLine", // rr → dd (delete line) + "s": "vim::PushDeleteSurrounds", // rs → ds (delete surrounds) + }, + }, + + // ───────────────────────────────────────────────────────────── + // CHANGE OPERATOR (after pressing c, vim_operator == c) + // c is unchanged so "cc" still works via the default binding. + // ───────────────────────────────────────────────────────────── + { + "context": "vim_operator == c", + "bindings": { + "c": "vim::CurrentLine", // cc → change line (default, kept) + "s": ["vim::PushChangeSurrounds", {}], // cs → change surrounds + }, + }, + + // ───────────────────────────────────────────────────────────── + // YANK OPERATOR (after pressing y) + // ───────────────────────────────────────────────────────────── + { + "context": "vim_operator == y", + "bindings": { + "y": "vim::CurrentLine", // yy → yank line (default, kept) + }, + }, + + // ───────────────────────────────────────────────────────────── + // INSERT MODE — keep ctrl shortcuts working + // ───────────────────────────────────────────────────────────── + { + "context": "vim_mode == insert", + "bindings": { + // Standard escape routes unchanged + "ctrl-[": "vim::NormalBefore", + "escape": "vim::NormalBefore", + // All other insert-mode bindings from the default vim keymap + // remain active (ctrl-w, ctrl-u, ctrl-r, ctrl-o, etc.) + }, + }, +] diff --git a/ZED/settings.json b/ZED/settings.json new file mode 100644 index 0000000..9bc042b --- /dev/null +++ b/ZED/settings.json @@ -0,0 +1,52 @@ +// 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) +{ + "disable_ai": true, + "auto_update": false, + "restore_on_startup": "empty_tab", + "base_keymap": "VSCode", + "vim_mode": true, + "vim": { + "cursor_shape": { + // Normal mode : solid block, no blink ← your "still rectangle" + "normal": "block", + + // Insert mode : blinking bar ← your "blinking in edit mode" + // NOTE: "cursor_blink": true is also set inside the insert override + // below so it only blinks in insert, not in normal. + "insert": "bar", + + // Replace mode : underline ← your "t" (PushReplace) mode + "replace": "underline", + + // Visual mode : block (same feel as normal, selection does the work) + "visual": "block", + }, + }, + "icon_theme": { + "mode": "light", + "light": "Zed (Default)", + "dark": "Zed (Default)", + }, + "ui_font_size": 16, + "buffer_font_size": 15.0, + "theme": { + "mode": "dark", + "light": "One Light", + "dark": "forsakenknight", + }, + "gutter": { + "line_numbers": true, + }, + "relative_line_numbers": "enabled", + "tab_size": 4, + "hard_tabs": false, + "auto_indent": "syntax_aware", + "semantic_tokens": "off", +} diff --git a/ZED/themes/forsakenknight.json b/ZED/themes/forsakenknight.json new file mode 100644 index 0000000..4e3258d --- /dev/null +++ b/ZED/themes/forsakenknight.json @@ -0,0 +1,256 @@ +{ + "$schema": "https://zed.dev/schema/themes/v0.2.0.json", + "name": "forsakenknight", + "author": "ForsakenKnight", + "themes": [ + { + "name": "forsakenknight", + "appearance": "dark", + "style": { + + // ── Palette ───────────── + // bg = #202325 + // keyword = #f8a8a1 (danger-11) + // string_ = #9bd0a1 (success-11) + // entity = #a0c6e0 (primary-11 — types, func names, packages) + // warm = #e5b899 (warning-11 — numbers, params, booleans) + // fg = #feffff (tint-12 — variables, brackets) + // comment = #787878 (neutral-9) + // operator = #bdc1c3 (tint-11) + // cursorline= #262d32 (primary-3) + // visual = #34495a + // linenr = #525252 (neutral-7) + // float_bg = #222222 + + // ── Editor background / foreground ──────────────────────── + "background": "#202325", + "editor.background": "#202325", + "editor.foreground": "#feffff", + "editor.line_number": "#525252", + "editor.active_line_number": "#e5b899", + "editor.active_line.background": "#262d32", + "editor.highlighted_line.background": "#262d32", + + // ── Selection / search ──────────────────────────────────── + "editor.selection": "#34495a", + "editor.selection.unfocused": "#2b3a47", + "search.match_background": "#e5b89940", + "editor.find_match_background": "#e5b89940", + "editor.find_all_matches_background": "#e5b89920", + + // ── Cursor ──────────────────────────────────────────────── + "editor.cursor": "#a0c6e0", + + // ── Gutter ──────────────────────────────────────────────── + "editor.gutter.background": "#202325", + + // ── Surfaces / panels ───────────────────────────────────── + "surface.background": "#222222", + "elevated_surface.background": "#222222", + "panel.background": "#1c1f21", + "panel.focused_border": "#a0c6e0", + "pane.focused_border": "#a0c6e0", + + // ── Borders ─────────────────────────────────────────────── + "border": "#2a2a2a", + "border.variant": "#2a2a2a", + "border.focused": "#a0c6e0", + "border.selected": "#a0c6e0", + "border.transparent": "#00000000", + "border.disabled": "#333333", + + // ── UI elements ─────────────────────────────────────────── + "element.background": "#202325", + "element.hover": "#262d32", + "element.active": "#2e3b45", + "element.selected": "#34495a", + "element.disabled": "#333333", + + // ── Text ────────────────────────────────────────────────── + "text": "#feffff", + "text.muted": "#787878", + "text.placeholder": "#525252", + "text.disabled": "#525252", + "text.accent": "#a0c6e0", + + // ── Icons ───────────────────────────────────────────────── + "icon": "#feffff", + "icon.muted": "#787878", + "icon.disabled": "#525252", + "icon.placeholder": "#525252", + "icon.accent": "#a0c6e0", + + // ── Status / title bars ─────────────────────────────────── + "status_bar.background": "#333333", + "title_bar.background": "#1c1f21", + "title_bar.inactive_background": "#1c1f21", + "toolbar.background": "#202325", + "tab_bar.background": "#252525", + "tab.inactive_background": "#252525", + "tab.active_background": "#333333", + + // ── Scrollbar ───────────────────────────────────────────── + "scrollbar.thumb.background": "#444444", + "scrollbar.thumb.hover_background": "#666666", + "scrollbar.thumb.border": "#444444", + "scrollbar.track.background": "#202325", + "scrollbar.track.border": "#2a2a2a", + + // ── Popups / autocomplete ───────────────────────────────── + "popover.background": "#2d2d2d", + "popover.shadow": "#00000066", + + // ── Diagnostics ─────────────────────────────────────────── + "error": "#fb2c36", + "error.background": "#fb2c3622", + "error.border": "#fb2c36", + "warning": "#fe9a00", + "warning.background": "#fe9a0022", + "warning.border": "#fe9a00", + "info": "#a0c6e0", + "info.background": "#a0c6e022", + "info.border": "#a0c6e0", + "hint": "#787878", + "hint.background": "#78787822", + "hint.border": "#787878", + + // ── Git ─────────────────────────────────────────────────── + "created": "#9bd0a1", + "modified": "#e5b899", + "deleted": "#fb2c36", + "conflict": "#fe9a00", + "hidden": "#525252", + "ignored": "#525252", + "renamed": "#a0c6e0", + + // ── Terminal ────────────────────────────────────────────── + "terminal.background": "#202325", + "terminal.foreground": "#feffff", + "terminal.bright_foreground": "#feffff", + "terminal.dim_foreground": "#787878", + "terminal.ansi.black": "#202325", + "terminal.ansi.red": "#f8a8a1", + "terminal.ansi.green": "#9bd0a1", + "terminal.ansi.yellow": "#e5b899", + "terminal.ansi.blue": "#a0c6e0", + "terminal.ansi.magenta": "#f8a8a1", + "terminal.ansi.cyan": "#9bd0a1", + "terminal.ansi.white": "#bdc1c3", + "terminal.ansi.bright_black": "#525252", + "terminal.ansi.bright_red": "#f8a8a1", + "terminal.ansi.bright_green": "#9bd0a1", + "terminal.ansi.bright_yellow": "#e5b899", + "terminal.ansi.bright_blue": "#a0c6e0", + "terminal.ansi.bright_magenta": "#f8a8a1", + "terminal.ansi.bright_cyan": "#9bd0a1", + "terminal.ansi.bright_white": "#feffff", + + // ── Link ────────────────────────────────────────────────── + "link_text.hover": "#a0c6e0", + + // ───────────────────────────────────────────────────────── + // SYNTAX (maps to Tree-sitter captures & LSP tokens) + // + // Color intent: + // keyword #f8a8a1 — control flow, storage, builtins + // string_ #9bd0a1 — string content + // entity #a0c6e0 — types, func/method names, packages, namespaces + // warm #e5b899 — numbers, booleans, constants, parameters, escape seqs + // fg #feffff — plain variables, brackets, delimiters + // comment #787878 — comments + // operator #bdc1c3 — operators + // ───────────────────────────────────────────────────────── + "syntax": { + + // ── Comments ──────────────────────────────────────────── + "comment": { "color": "#787878" }, + "comment.doc": { "color": "#787878" }, + + // ── Keywords / control flow ───────────────────────────── + "keyword": { "color": "#f8a8a1" }, + "keyword.control": { "color": "#f8a8a1" }, + "keyword.operator": { "color": "#f8a8a1" }, + "keyword.function": { "color": "#f8a8a1" }, + "keyword.return": { "color": "#f8a8a1" }, + "keyword.exception": { "color": "#f8a8a1" }, + "keyword.import": { "color": "#f8a8a1" }, + "keyword.type": { "color": "#f8a8a1" }, + "keyword.modifier": { "color": "#f8a8a1" }, + + // ── Strings ───────────────────────────────────────────── + "string": { "color": "#9bd0a1" }, + "string.doc": { "color": "#9bd0a1" }, + "string.regex": { "color": "#9bd0a1" }, + // Escape sequences and format verbs → warm (mirrors LgwtdEscape / LgwtdFmtVerb) + "string.escape": { "color": "#e5b899" }, + "string.special": { "color": "#e5b899" }, + + // ── Numbers / booleans / nil ───────────────────────────── + // nil, true, false are remapped to @number in highlights.scm (warm) + "number": { "color": "#e5b899" }, + "boolean": { "color": "#e5b899" }, + + // ── Types ──────────────────────────────────────────────── + // Includes struct, interface, type aliases, built-in types + "type": { "color": "#a0c6e0" }, + "type.builtin": { "color": "#f8a8a1" }, // mirrors @type.builtin = keyword + "type.enum_member": { "color": "#e5b899" }, + + // ── Functions / methods ────────────────────────────────── + "function": { "color": "#a0c6e0" }, + "function.method": { "color": "#a0c6e0" }, + "function.builtin": { "color": "#a0c6e0" }, + "function.macro": { "color": "#a0c6e0" }, + "function.special": { "color": "#a0c6e0" }, + + // ── Constructors ───────────────────────────────────────── + "constructor": { "color": "#a0c6e0" }, + + // ── Variables ──────────────────────────────────────────── + "variable": { "color": "#feffff" }, + "variable.builtin": { "color": "#f8a8a1" }, // mirrors @variable.builtin = keyword + "variable.parameter": { "color": "#e5b899" }, // mirrors @variable.parameter = warm + "variable.member": { "color": "#feffff" }, + "variable.special": { "color": "#f8a8a1" }, + + // ── Constants ──────────────────────────────────────────── + "constant": { "color": "#e5b899" }, + "constant.builtin": { "color": "#f8a8a1" }, // iota etc → keyword color + "constant.macro": { "color": "#a0c6e0" }, + + // ── Namespaces / packages / modules ────────────────────── + "namespace": { "color": "#a0c6e0" }, + + // ── Properties / fields ─────────────────────────────────── + "property": { "color": "#feffff" }, + "field": { "color": "#feffff" }, + "attribute": { "color": "#e5b899" }, + + // ── Operators / punctuation ─────────────────────────────── + "operator": { "color": "#bdc1c3" }, + "punctuation": { "color": "#feffff" }, + "punctuation.bracket":{ "color": "#feffff" }, + "punctuation.delimiter": { "color": "#feffff" }, + "punctuation.special":{ "color": "#feffff" }, + "delimiter": { "color": "#feffff" }, + + // ── Labels ──────────────────────────────────────────────── + "label": { "color": "#e5b899" }, + + // ── Tags (HTML/JSX/XML — unlikely in Go but complete) ───── + "tag": { "color": "#a0c6e0" }, + "tag.attribute": { "color": "#e5b899" }, + "tag.delimiter": { "color": "#feffff" }, + + // ── Markup ──────────────────────────────────────────────── + "link_uri": { "color": "#a0c6e0" }, + "link_text": { "color": "#a0c6e0" }, + "title": { "color": "#a0c6e0" }, + + // ── Embedded ───────────────────────────────────────────── + "preproc": { "color": "#f8a8a1" } + } + } + } + ] +}