From 086f3c78be03b58416fbd1248dcdc70f3d4c67d1 Mon Sep 17 00:00:00 2001 From: Uzair Aftab <48220549+Uzaaft@users.noreply.github.com> Date: Wed, 6 Sep 2023 07:55:54 +0200 Subject: [PATCH] feat(pack): Add zig pack (#557) --- lua/astrocommunity/pack/zig/README.md | 14 ++++++++++++++ lua/astrocommunity/pack/zig/init.lua | 27 +++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 lua/astrocommunity/pack/zig/README.md create mode 100644 lua/astrocommunity/pack/zig/init.lua diff --git a/lua/astrocommunity/pack/zig/README.md b/lua/astrocommunity/pack/zig/README.md new file mode 100644 index 000000000..77a7b37e5 --- /dev/null +++ b/lua/astrocommunity/pack/zig/README.md @@ -0,0 +1,14 @@ +# Zig Language Pack + +**Requirements:** + +- git (required by zig-tools) +- curl / wget (required by zig-tools) +- Neovim (>= 0.7.x) +- ripgrep (>= 11.0) + +This plugin pack does the following: + +- Adds `zig` Treesitter parsers +- Adds `zls` language server +- Adds [zig-tools.nvim](https://github.com/NTBBloodbath/zig-tools.nvim) diff --git a/lua/astrocommunity/pack/zig/init.lua b/lua/astrocommunity/pack/zig/init.lua new file mode 100644 index 000000000..c5acf0965 --- /dev/null +++ b/lua/astrocommunity/pack/zig/init.lua @@ -0,0 +1,27 @@ +local utils = require "astronvim.utils" + +return { + { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + if opts.ensure_installed ~= "all" then + opts.ensure_installed = utils.list_insert_unique(opts.ensure_installed, { "zig" }) + end + end, + }, + { + "williamboman/mason-lspconfig.nvim", + opts = function(_, opts) opts.ensure_installed = utils.list_insert_unique(opts.ensure_installed, "zls") end, + }, + + { + "NTBBloodbath/zig-tools.nvim", + -- Load zig-tools.nvim only in Zig buffers + ft = { "zig" }, + opts = {}, + dependencies = { + "akinsho/toggleterm.nvim", + "nvim-lua/plenary.nvim", + }, + }, +}