feat!: add zed editor, format files

This commit is contained in:
2025-06-29 16:36:45 -07:00
parent f6c13e0ec7
commit 2f97bc9774
9 changed files with 250 additions and 133 deletions

View File

@@ -1,122 +1,122 @@
local function setup_luau() local function setup_luau()
require("luau-lsp").setup({ require("luau-lsp").setup({
platform = { platform = {
type = "roblox", type = "roblox",
}, },
types = { types = {
roblox_security_level = "PluginSecurity", roblox_security_level = "PluginSecurity",
}, },
sourcemap = { sourcemap = {
enabled = true, enabled = true,
autogenerate = true, autogenerate = true,
rojo_project_file = "default.project.json", rojo_project_file = "default.project.json",
sourcemap_file = "sourcemap.json", sourcemap_file = "sourcemap.json",
}, },
plugin = { plugin = {
enabled = true, enabled = true,
port = 3667, port = 3667,
}, },
fflags = { fflags = {
enable_new_solver = true, enable_new_solver = true,
sync = true, sync = true,
}, },
}) })
end end
return { return {
{ {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
dependencies = { dependencies = {
"williamboman/mason.nvim", "williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim", "williamboman/mason-lspconfig.nvim",
"j-hui/fidget.nvim", "j-hui/fidget.nvim",
"lopi-py/luau-lsp.nvim", "lopi-py/luau-lsp.nvim",
"hrsh7th/nvim-cmp", "hrsh7th/nvim-cmp",
"hrsh7th/cmp-cmdline", "hrsh7th/cmp-cmdline",
"hrsh7th/cmp-path", "hrsh7th/cmp-path",
"hrsh7th/cmp-buffer", "hrsh7th/cmp-buffer",
"hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-nvim-lsp",
}, },
config = function() config = function()
require("mason").setup() require("mason").setup()
require("fidget").setup({ require("fidget").setup({
notification = { notification = {
window = { window = {
winblend = 0, winblend = 0,
}, },
}, },
}) })
require("mason-lspconfig").setup({ require("mason-lspconfig").setup({
ensure_installed = { ensure_installed = {
"ts_ls", "ts_ls",
"lua_ls", "lua_ls",
"luau_lsp", "luau_lsp",
"rust_analyzer", "rust_analyzer",
"nil_ls", "nil_ls",
"tailwindcss", "tailwindcss",
"svelte", "svelte",
"html", "html",
"gopls", "gopls",
"templ", "templ",
}, },
automatic_enable = { exclude = { "luau_lsp" } }, automatic_enable = { exclude = { "luau_lsp" } },
}) })
setup_luau() setup_luau()
local cmp = require("cmp") local cmp = require("cmp")
cmp.setup({ cmp.setup({
snippet = { snippet = {
expand = function(args) expand = function(args)
require("luasnip").lsp_expand(args.body) require("luasnip").lsp_expand(args.body)
end, end,
}, },
window = { window = {
completion = cmp.config.window.bordered(), completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(), documentation = cmp.config.window.bordered(),
}, },
mapping = cmp.mapping.preset.insert({ mapping = cmp.mapping.preset.insert({
["<C-b>"] = cmp.mapping.scroll_docs(-4), ["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4), ["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(), ["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(), ["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm({ select = true }), ["<CR>"] = cmp.mapping.confirm({ select = true }),
}), }),
sources = cmp.config.sources({ sources = cmp.config.sources({
{ name = "nvim_lsp" }, { name = "nvim_lsp" },
{ name = "luasnip" }, { name = "luasnip" },
}, { }, {
{ name = "buffer" }, { name = "buffer" },
}), }),
}) })
local capabilities = require("cmp_nvim_lsp").default_capabilities() local capabilities = require("cmp_nvim_lsp").default_capabilities()
vim.lsp.config("*", { vim.lsp.config("*", {
capabilities = capabilities, capabilities = capabilities,
}) })
vim.keymap.set("n", "gtd", vim.lsp.buf.definition) vim.keymap.set("n", "gtd", vim.lsp.buf.definition)
vim.keymap.set("n", "ev", function() vim.keymap.set("n", "ev", function()
vim.diagnostic.open_float({ border = "rounded" }) vim.diagnostic.open_float({ border = "rounded" })
end) end)
vim.keymap.set("n", "K", function() vim.keymap.set("n", "K", function()
vim.lsp.buf.hover({ border = "rounded" }) vim.lsp.buf.hover({ border = "rounded" })
end) end)
vim.keymap.set("i", "<C-s>", function() vim.keymap.set("i", "<C-s>", function()
vim.lsp.buf.signature_help({ border = "rounded" }) vim.lsp.buf.signature_help({ border = "rounded" })
end) end)
vim.diagnostic.config({ virtual_text = true }) vim.diagnostic.config({ virtual_text = true })
cmp.setup.cmdline({ "/", "?" }, { cmp.setup.cmdline({ "/", "?" }, {
mapping = cmp.mapping.preset.cmdline(), mapping = cmp.mapping.preset.cmdline(),
sources = { sources = {
{ name = "buffer" }, { name = "buffer" },
}, },
}) })
cmp.setup.cmdline(":", { cmp.setup.cmdline(":", {
mapping = cmp.mapping.preset.cmdline(), mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({ sources = cmp.config.sources({
{ name = "path" }, { name = "path" },
}, { }, {
{ name = "cmdline" }, { name = "cmdline" },
}), }),
matching = { disallow_symbol_nonprefix_matching = false }, matching = { disallow_symbol_nonprefix_matching = false },
}) })
end, end,
}, },
} }

View File

Binary file not shown.

View File

@@ -1,4 +1,6 @@
.git .git
.gitignore .gitignore
aliases
custom custom
astal
nix nix

View File

@@ -1,12 +1,24 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }: {
config,
lib,
pkgs,
modulesPath,
...
}:
{ {
imports = [ ]; imports = [ ];
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "ehci_pci" "nvme" "sr_mod" ]; boot.initrd.availableKernelModules = [
"ata_piix"
"uhci_hcd"
"ehci_pci"
"nvme"
"sr_mod"
];
boot.initrd.kernelModules = [ "dm-snapshot" ]; boot.initrd.kernelModules = [ "dm-snapshot" ];
boot.kernelModules = [ ]; boot.kernelModules = [ ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];

View File

@@ -1,28 +1,44 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }: {
config,
lib,
pkgs,
modulesPath,
...
}:
{ {
imports = imports = [
[ (modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; boot.initrd.availableKernelModules = [
"nvme"
"xhci_pci"
"ahci"
"usbhid"
"usb_storage"
"sd_mod"
];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ]; boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/d751775f-e83d-4230-9228-d1b58c5cc534"; device = "/dev/disk/by-uuid/d751775f-e83d-4230-9228-d1b58c5cc534";
fsType = "btrfs"; fsType = "btrfs";
}; };
fileSystems."/boot" = fileSystems."/boot" = {
{ device = "/dev/disk/by-uuid/5C2F-86EC"; device = "/dev/disk/by-uuid/5C2F-86EC";
fsType = "vfat"; fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ]; options = [
}; "fmask=0022"
"dmask=0022"
];
};
swapDevices = [ ]; swapDevices = [ ];

View File

@@ -14,5 +14,6 @@
./keys.nix ./keys.nix
./rofi.nix ./rofi.nix
./desktop.nix ./desktop.nix
./zed-editor.nix
]; ];
} }

View File

@@ -38,6 +38,7 @@
wl-clip-persist wl-clip-persist
wdisplays wdisplays
efibootmgr efibootmgr
nixd
]; ];
programs.thunar.enable = true; programs.thunar.enable = true;
programs.hyprland = { programs.hyprland = {
@@ -51,6 +52,7 @@
}; };
rofi.enable = true; rofi.enable = true;
services.upower.enable = true; services.upower.enable = true;
zed.enable = true;
home-manager.users.luca = { home-manager.users.luca = {
programs = { programs = {

View File

@@ -0,0 +1,84 @@
{
pkgs,
lib,
config,
...
}:
{
options.zed = {
enable = lib.mkEnableOption "enable zed";
};
config = lib.mkIf config.zed.enable {
home-manager.users.luca = {
programs.zed-editor = {
enable = true;
extraPackages = with pkgs; [ nixd ];
extensions = [
"luau"
"nix"
"rose-pine-theme"
];
userSettings = {
features = {
edit_prediction_provider = "none";
};
edit_predictions = null;
vim_mode = true;
ui_font_size = 16;
buffer_font_size = 16;
theme = {
mode = "dark";
dark = "Rosé Pine";
};
diagnostics = {
inline = {
enabled = true;
};
};
format_on_save = "on";
lsp = {
"luau-lsp" = {
settings = {
ext = {
roblox = {
enabled = true;
security_level = "plugin";
};
fflags = {
enable_new_solver = true;
sync = true;
};
};
};
};
nixd = {
initialization_options = {
formatting = {
command = [
"nixfmt"
"--quiet"
"--"
];
};
};
};
};
languages = {
Luau = {
formatter = {
external = {
command = "stylua";
arguments = [ "-" ];
};
};
};
Nix = {
language_servers = [ "nixd" ];
};
};
};
};
};
};
}