-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzed.nix
108 lines (105 loc) · 2.36 KB
/
zed.nix
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
{
lib,
custom-config,
unstable,
...
}: let
inherit (lib) mkEnableOption mkIf mkOption types;
cfg = custom-config.zed;
settings = {
theme = "One Dark";
vim_mode = true;
autosave = "on_focus_change";
soft_wrap = "editor_width";
tab_bar = {show = false;};
vertical_scroll_margin = 10;
scrollbar = {show = "never";};
copilot = {
disabled_globs = [".env"];
};
file_types = {
CSS = ["scss" "css"];
};
vim = {
use_system_clipboard = "never";
use_multiline_find = true;
use_smartcase_find = true;
};
buffer_font_size = 17;
buffer_font_family = "Dank Mono";
buffer_font_features = {
ss01 = true;
ss02 = true;
ss03 = true;
ss04 = true;
ss05 = true;
ss06 = true;
ss07 = true;
ss08 = true;
calt = true;
dlig = true;
};
preview_tabs = {
enabled = true;
enable_preview_from_file_finder = true;
enable_preview_from_code_navigation = true;
};
languages = {
Elixir = {
language_servers = ["lexical" "!next-ls" "!elixir-ls"];
};
HEEX = {
language_servers = ["lexical" "!next-ls" "!elixir-ls"];
};
};
lsp = {
lexical = {
binary = {
path = "${unstable.lexical}/bin/lexical";
};
};
next-ls = {
binary = {
path = "${unstable.next-ls}/bin/nextls";
arguments = ["--stdio"];
};
initialization_options = {
extensions = {
credo.enable = false;
};
experimental = {
completions.enable = true;
};
};
};
};
};
in {
options.zed = {
enable = mkEnableOption "Enables zed configurations";
elixir = {
lsp = mkOption {
default = "lexical";
type = types.enum ["next_ls" "lexical"];
description = "The LSP to use for Elixir lang";
};
};
};
config = mkIf cfg.enable {
# home.packages = with pkgs; [zed-editor];
home.file = {
settings = {
enable = true;
target = ".config/zed/settings.json";
text = builtins.toJSON settings;
};
};
home.file = {
keymap = {
enable = true;
target = ".config/zed/keymap.json";
text = builtins.toJSON (builtins.readFile ./zed/keymap.json);
};
};
};
}