From 33120b06c20e2fcb7251fb575eb166c6c920a8d5 Mon Sep 17 00:00:00 2001 From: kossLAN Date: Mon, 14 Jul 2025 10:24:14 -0400 Subject: [PATCH] feat: zig lsp --- nix/neovim-overlay.nix | 1 + nvim/ftplugin/zig.lua | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 nvim/ftplugin/zig.lua diff --git a/nix/neovim-overlay.nix b/nix/neovim-overlay.nix index ea0d5fc..fba7bd1 100644 --- a/nix/neovim-overlay.nix +++ b/nix/neovim-overlay.nix @@ -105,6 +105,7 @@ with final.pkgs.lib; let jdt-language-server # java ls nil # nix lsp rust-analyzer # rust LSP + zls # zig LSP vscode-langservers-extracted # various web dev lsps from vscode typescript-language-server # css lsp thing qt6.qtdeclarative # qmlls diff --git a/nvim/ftplugin/zig.lua b/nvim/ftplugin/zig.lua new file mode 100644 index 0000000..1826828 --- /dev/null +++ b/nvim/ftplugin/zig.lua @@ -0,0 +1,19 @@ +if vim.fn.executable('zls') ~= 1 then + return +end + +local root_files = { + 'zls.json', + 'build.zig', + '.git', +} + +local lsp = require('user.lsp') + +vim.lsp.start { + name = 'zls', + cmd = { 'zls' }, + root_dir = vim.fs.dirname(vim.fs.find(root_files, { upward = true })[1]), + capabilities = lsp.make_client_capabilities(), + on_attach = lsp.on_attach, +}