nix/programs/zed: init config
Anirudh Oppiliappan x@icyphox.sh
Mon, 26 Aug 2024 13:35:08 +0300
5 files changed,
389 insertions(+),
0 deletions(-)
M
programs/common.nix
→
programs/common.nix
@@ -15,6 +15,7 @@ ./bash.nix
./ssh.nix ./alacritty.nix ./fish.nix + ./zed/default.nix ]; programs = {
A
programs/zed/default.nix
@@ -0,0 +1,10 @@
+{ config, pkgs, ... }: + +let + settings = import ./settings.nix; + keymap = import ./keymap.nix; +in +{ + home.file.".config/zed/themes/icy.json".source = ./themes/icy.json; + imports = [ settings keymap ]; +}
A
programs/zed/keymap.nix
@@ -0,0 +1,38 @@
+{ pkgs, ... }: + +let + keymap = [ + { + context = "Dock || Terminal || Editor"; + bindings = { + "alt-y" = [ "workspace::ActivatePaneInDirection" "Left" ]; + "alt-o" = [ "workspace::ActivatePaneInDirection" "Right" ]; + "alt-e" = [ "workspace::ActivatePaneInDirection" "Up" ]; + "alt-n" = [ "workspace::ActivatePaneInDirection" "Down" ]; + }; + } + { + context = "VimControl && !VimWaiting && !menu"; + bindings = { + "space o" = "tab_switcher::Toggle"; + "space t" = "workspace::NewCenterTerminal"; + "space n" = "pane::ActivateNextItem"; + "space p" = "pane::ActivatePrevItem"; + "space e" = "file_finder::Toggle"; + "space shift-e" = "workspace::NewSearch"; + }; + } + { + context = "Workspace"; + bindings = { + "ctrl-q c" = "pane::SplitRight"; + "ctrl-q \"" = "pane::SplitDown"; + }; + } + ]; + + keymapFile = pkgs.writeText "keymap.json" (builtins.toJSON keymap); +in +{ + home.file.".config/zed/keymap.json".source = keymapFile; +}
A
programs/zed/settings.nix
@@ -0,0 +1,69 @@
+{ config, pkgs, lib, ... }: + +let + zedSettings = { + telemetry = { + diagnostics = false; + metrics = false; + }; + base_keymap = "VSCode"; + buffer_font_size = 15; + theme = "Icy Light"; + buffer_font_family = "SF Mono"; + buffer_font_weight = 500; + ui_font_family = "System Font"; + ui_font_size = 18; + vim_mode = true; + vim = { + use_system_clipboard = "never"; + }; + gutter = { + line_numbers = false; + }; + terminal = { + working_directory = "current_project_directory"; + option_as_meta = true; + env = { + EDITOR = "zed --wait"; + }; + shell = { + program = "fish"; + }; + }; + project_panel = { + file_icons = false; + folder_icons = false; + indent_size = 10; + }; + chat_panel = { + button = false; + }; + collaboration_panel = { + button = false; + }; + assistant = { + default_model = { + provider = "copilot_chat"; + model = "gpt-4"; + }; + version = "2"; + enabled = true; + button = true; + }; + scrollbar = { + show = "auto"; + }; + toolbar = { + breadcrumbs = true; + quick_actions = true; + }; + tab_bar = { + show = false; + }; + }; + + zedSettingsFile = pkgs.writeText "settings.json" (builtins.toJSON zedSettings); +in +{ + home.file.".config/zed/settings.json".source = zedSettingsFile; +}
A
programs/zed/themes/icy.json
@@ -0,0 +1,271 @@
+{ + "$schema": "https://zed.dev/schema/themes/v0.1.0.json", + "name": "Icy", + "author": "Anirudh Oppiliappan (icyphox)", + "themes": [ + { + "name": "Icy Light", + "appearance": "light", + "style": { + "border": "#dddddd", + "border.variant": "#dddddd", + "border.focused": "#dddddd", + "border.selected": "#dddddd", + "border.transparent": "#f1f1f1", + "border.disabled": "#8a8a8a", + "elevated_surface.background": "#f4f4f4", + "surface.background": "#f4f4f4", + "background": "#f4f4f4", + "element.background": "#f4f4f4", + "element.hover": "#8e69d53d", + "element.active": "#dddddd", + "element.selected": "#dddddd", + "element.disabled": "#aaaaaa", + "drop_target.background": "#aaaaaa", + "ghost_element.background": "#f4f4f4", + "ghost_element.hover": "#dddddddd", + "ghost_element.active": "#dddddd", + "ghost_element.selected": "#dddddd", + "ghost_element.disabled": "#aaaaaa", + "text": "#676767", + "text.muted": "#525252", + "text.placeholder": "#8a8a8a", + "text.disabled": "#aaaaaa", + "text.accent": "#6587bf", + "icon": "#f4f4f4", + "icon.muted": "#525252", + "icon.disabled": "#aaaaaa", + "icon.placeholder": "#8a8a8a", + "icon.accent": "#6587bf", + "status_bar.background": "#f4f4f4", + "title_bar.background": "#f4f4f4", + "toolbar.background": "#f4f4f4", + "tab_bar.background": "#f4f4f4", + "tab.inactive_background": "#f4f4f4", + "tab.active_background": "#dddddd", + "search.match_background": "#fadaa0", + "panel.background": "#f4f4f4", + "panel.focused_border": "#db7070", + "pane.focused_border": "#db7070", + "scrollbar_thumb.background": "#e7e7e7", + "scrollbar.thumb.hover_background": "#d69822", + "scrollbar.thumb.border": "#f4f4f4", + "scrollbar.track.background": "#f1f1f1", + "scrollbar.track.border": "#f4f4f4", + "editor.foreground": "#676767", + "editor.background": "#f4f4f4", + "editor.gutter.background": "#f4f4f4", + "editor.subheader.background": "#dddddd", + "editor.active_line.background": "#f4f4f4", + "editor.highlighted_line.background": "#d6f5f5f5", + "editor.line_number": "#676767", + "editor.active_line_number": "#676767", + "editor.invisible": "#aaaaaa", + "editor.wrap_guide": "#aaaaaa", + "editor.active_wrap_guide": "#e7e7e7", + "editor.document_highlight.read_background": "#b870ce33", + "editor.document_highlight.write_background": "#db707033", + "terminal.background": "#f4f4f4", + "terminal.foreground": "#676767", + "terminal.bright_foreground": "#525252", + "terminal.dim_foreground": "#8a8a8a", + "terminal.ansi.black": "#676767", + "terminal.ansi.bright_black": "#aaaaaa", + "terminal.ansi.dim_black": "#676767", + "terminal.ansi.red": "#db7070", + "terminal.ansi.bright_red": "#c66666", + "terminal.ansi.dim_red": "#8a8a8a", + "terminal.ansi.green": "#7c9f4b", + "terminal.ansi.bright_green": "#6d8b42", + "terminal.ansi.dim_green": "#525252", + "terminal.ansi.yellow": "#d69822", + "terminal.ansi.bright_yellow": "#e7e7e7", + "terminal.ansi.dim_yellow": "#aaaaaa", + "terminal.ansi.blue": "#6587bf", + "terminal.ansi.bright_blue": "#8a8a8a", + "terminal.ansi.dim_blue": "#676767", + "terminal.ansi.magenta": "#b870ce", + "terminal.ansi.bright_magenta": "#a262b5", + "terminal.ansi.dim_magenta": "#525252", + "terminal.ansi.cyan": "#509c93", + "terminal.ansi.bright_cyan": "#43827b", + "terminal.ansi.dim_cyan": "#8a8a8a", + "terminal.ansi.white": "#676767", + "terminal.ansi.bright_white": "#525252", + "terminal.ansi.dim_white": "#8a8a8a", + "link_text.hover": "#509c933d", + "conflict": "#db7070", + "conflict.background": "#db707033", + "conflict.border": "#db7070", + "created": "#7c9f4b", + "created.background": "#7c9f4b33", + "created.border": "#7c9f4b", + "deleted": "#db7070", + "deleted.background": "#db707033", + "deleted.border": "#db7070", + "error": "#db7070", + "error.background": "#db707033", + "error.border": "#db7070", + "hidden": "#525252", + "hidden.background": "#f4f4f4", + "hidden.border": "#aaaaaa", + "hint": "#676767", + "hint.background": "#67676733", + "hint.border": "#676767", + "ignored": "#676767", + "ignored.background": "#67676733", + "ignored.border": "#676767", + "info": "#509c93", + "info.background": "#509c9333", + "info.border": "#509c93", + "modified": "#7c9f4b", + "modified.background": "#7c9f4b33", + "modified.border": "#7c9f4b", + "predictive": "#777777", + "predictive.background": "#d6982233", + "predictive.border": "#d69822", + "renamed": "#6587bf", + "renamed.background": "#6587bf33", + "renamed.border": "#6587bf", + "success": "#7c9f4b", + "success.background": "#7c9f4b33", + "success.border": "#7c9f4b", + "unreachable": "#db7070", + "unreachable.background": "#db707033", + "unreachable.border": "#db7070", + "warning": "#d69822", + "warning.background": "#d6982233", + "warning.border": "#d69822", + "players": [ + { + "cursor": "#509c93", + "background": "#509c93", + "selection": "#dddddddd" + }, + { + "cursor": "#b870ce", + "background": "#b870ce", + "selection": "#b870ce3d" + }, + { + "cursor": "#db7070", + "background": "#db7070", + "selection": "#db70703d" + }, + { + "cursor": "#a262b5", + "background": "#a262b5", + "selection": "#a262b53d" + }, + { + "cursor": "#6587bf", + "background": "#6587bf", + "selection": "#6587bf3d" + }, + { + "cursor": "#43827b", + "background": "#43827b", + "selection": "#43827b3d" + }, + { + "cursor": "#d69822", + "background": "#d69822", + "selection": "#d698223d" + }, + { + "cursor": "#7c9f4b", + "background": "#7c9f4b", + "selection": "#7c9f4b3d" + } + ], + "syntax": { + "attribute": { + "color": "#509c93", + "font_style": "normal", + "font_weight": 400 + }, + "boolean": { + "color": "#b870ce", + "font_style": "normal", + "font_weight": 600 + }, + "comment": { + "color": "#8a8a8a", + "font_style": "italic", + "font_weight": 400 + }, + "comment.doc": { + "color": "#8a8a8a", + "font_style": "italic", + "font_weight": 400 + }, + "constant": { + "color": "#b870ce", + "font_style": "normal", + "font_weight": 400 + }, + "function": { + "color": "#676767", + "font_style": "normal", + "font_weight": 400 + }, + "keyword": { + "color": "#676767", + "font_style": "normal", + "font_weight": 600 + }, + "number": { + "color": "#b870ce", + "font_style": "normal", + "font_weight": 400 + }, + "string": { + "color": "#509c93", + "font_style": "normal", + "font_weight": 400 + }, + "variable": { + "color": "#676767", + "font_style": "normal", + "font_weight": 400 + }, + "operator": { + "color": "#676767", + "font_style": "normal", + "font_weight": 400 + }, + "type": { + "color": "#676767", + "font_style": "normal", + "font_weight": 400 + }, + "punctuation": { + "color": "#525252", + "font_style": "normal", + "font_weight": 400 + }, + "error": { + "color": "#db7070", + "font_style": "normal", + "font_weight": 600 + }, + "warning": { + "color": "#d69822", + "font_style": "normal", + "font_weight": 600 + }, + "info": { + "color": "#509c93", + "font_style": "normal", + "font_weight": 600 + }, + "hint": { + "color": "#7c9f4b", + "font_style": "normal", + "font_weight": 600 + } + } + } + } + ] +}