From b1584b9ea0731f39950af1473c10043be0aa3fec Mon Sep 17 00:00:00 2001 From: Manuuurino <2855338+manuuurino@users.noreply.github.com> Date: Sat, 30 Mar 2024 16:27:08 +0100 Subject: [PATCH] feat(pack): add fish pack (#817) * feat(pack): add fish pack * fix(fish): Use mason-null-ls instead of none-ls * Revert "fix(fish): Use mason-null-ls instead of none-ls" This reverts commit 26232a165f53f4c87d002b46c24dd978f69a377e. * fix(fish): add requirements in the README for fish pack --------- Co-authored-by: Uzair Aftab --- lua/astrocommunity/pack/fish/README.md | 11 +++++++ lua/astrocommunity/pack/fish/init.lua | 41 ++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 lua/astrocommunity/pack/fish/README.md create mode 100644 lua/astrocommunity/pack/fish/init.lua diff --git a/lua/astrocommunity/pack/fish/README.md b/lua/astrocommunity/pack/fish/README.md new file mode 100644 index 000000000..6dd1a3e99 --- /dev/null +++ b/lua/astrocommunity/pack/fish/README.md @@ -0,0 +1,11 @@ +# Elm Language Pack + +Requires the following in your `PATH` + +- [fish](https://github.com/fish-shell/fish-shell) + +This plugin pack does the following: + +- Adds `fish` Treesitter parser +- Adds `fish_indent` formatter +- Adds `fish` linter diff --git a/lua/astrocommunity/pack/fish/init.lua b/lua/astrocommunity/pack/fish/init.lua new file mode 100644 index 000000000..c415ec4f6 --- /dev/null +++ b/lua/astrocommunity/pack/fish/init.lua @@ -0,0 +1,41 @@ +return { + { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + if opts.ensure_installed ~= "all" then + opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "fish" }) + end + end, + }, + { + "nvimtools/none-ls.nvim", + optional = true, + opts = function(_, opts) + local nls = require "null-ls" + if type(opts.sources) == "table" then + opts.sources = vim.list_extend(opts.sources, { + nls.builtins.formatting.fish_indent, + nls.builtins.diagnostics.fish, + }) + end + end, + }, + { + "stevearc/conform.nvim", + optional = true, + opts = { + formatters_by_ft = { + fish = { "fish_indent" }, + }, + }, + }, + { + "mfussenegger/nvim-lint", + optional = true, + opts = { + linters_by_ft = { + fish = { "fish" }, + }, + }, + }, +}