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, +}