Home

dotnix @253f360ccf765494bd350ddc23d015b380ab32a7 - refs - log -
-
https://git.jolheiser.com/dotnix.git
My nix dotfiles
dotnix / apps / gui / zed.nix
- raw
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
{ pkgs, ... }:
let
  zed-fhs = pkgs.buildFHSUserEnv {
    name = "zed";
    targetPkgs =
      pkgs: with pkgs; [
        zed-editor
        nixd
      ];
    runScript = "zed";
  };
in
{
  home.packages = [ zed-fhs ];
  xdg.configFile = {
    "zed/settings.json".text = builtins.toJSON {
      buffer_font_family = "Monaspace Neon";
      buffer_font_size = 13;
      soft_wrap = "editor_width";
      telemetry = {
        diagnostics = false;
        metrics = false;
      };
      terminal = {
        font_family = "Monaspace Neon";
        shell = {
          program = "nu";
        };
      };
      theme = "Catppuccin Mocha";
      ui_font_size = 15;
      vim_mode = true;
      relative_line_numbers = true;
      vim = {
        use_system_clipboard = "always";
        use_multiline_find = true;
      };
      tab_bar.show = false;
      toolbar = {
        breadcrumbs = true;
        quick_actions = false;
      };
      assistant = {
        version = "1";
        provider.name = "anthropic";
      };
    };
    "zed/keymap.json".text =
      let
        leader = "space";
      in
      builtins.toJSON [
        {
          "context" = "Dock || Terminal || Editor";
          "bindings" = {
            "ctrl-h" = [
              "workspace::ActivatePaneInDirection"
              "Left"
            ];
            "ctrl-l" = [
              "workspace::ActivatePaneInDirection"
              "Right"
            ];
            "ctrl-k" = [
              "workspace::ActivatePaneInDirection"
              "Up"
            ];
            "ctrl-j" = [
              "workspace::ActivatePaneInDirection"
              "Down"
            ];
          };
        }
        {
          "context" = "Editor && VimControl && !VimWaiting && !menu";
          "bindings" = {
            "${leader} b" = "editor::ToggleGitBlame";
            "${leader} k" = "editor::Hover";
            "${leader} a" = "editor::ToggleCodeActions";
            "${leader} l f" = "editor::Format";
            "${leader} d" = "diagnostics::Deploy";
            "${leader} f" = "file_finder::Toggle";
            "${leader} o" = "tab_switcher::Toggle";
            "${leader} e" = "workspace::ToggleLeftDock";
            "${leader} /" = "workspace::NewSearch";
            "n" = "search::SelectNextMatch";
            "shift-n" = "search::SelectPrevMatch";
            "${leader} t" = "workspace::NewCenterTerminal";
            "${leader} c" = "editor::ToggleComments";
            "${leader} w" = "workspace::Save";
          };
        }
        {
          "context" = "Editor && vim_mode == visual && !VimWaiting && !VimObject";
          "bindings" = {
            "shift-j" = "editor::MoveLineDown";
            "shift-k" = "editor::MoveLineUp";
          };
        }
        {
          "context" = "Workspace";
          "bindings" = {
            "ctrl-z" = "workspace::ToggleZoom";
            "cmd-k" = [
              "projects::OpenRecent"
              { "create_new_window" = false; }
            ];
            "ctrl-x" = "tab_switcher::CloseSelectedItem";
          };
        }
        {
          "context" = "Terminal";
          "bindings" = {
            "cmd-t" = "workspace::NewTerminal";
          };
        }
      ];
  };
}