Skip to content

Commit

Permalink
feat(pack): add yaml language pack
Browse files Browse the repository at this point in the history
  • Loading branch information
mehalter authored and luxus committed Mar 10, 2023
1 parent 6b9d9c0 commit 74473d8
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lua/astrocommunity/pack/yaml/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# YAML Language Pack

This plugin pack does the following:

- Adds `yaml` Treesitter parser
- Adds `yamlls` language server
- Adds `prettier` formatter
32 changes: 32 additions & 0 deletions lua/astrocommunity/pack/yaml/yaml.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
local utils = require "astrocommunity.utils"
return {
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
-- Ensure that opts.ensure_installed exists and is a table or string "all".
if not opts.ensure_installed then
opts.ensure_installed = {}
elseif opts.ensure_installed == "all" then
return
end
utils.list_insert_unique(opts.ensure_installed, "yaml")
end,
},
{
"williamboman/mason-lspconfig.nvim",
opts = function(_, opts)
-- Ensure that opts.ensure_installed exists and is a table
if not opts.ensure_installed then opts.ensure_installed = {} end
utils.list_insert_unique(opts.ensure_installed, "yamlls")
end,
},
{
"jay-babu/mason-null-ls.nvim",
opts = function(_, opts)
-- Ensure that opts.ensure_installed exists and is a table.
if not opts.ensure_installed then opts.ensure_installed = {} end
-- Add go lsps to opts.ensure_installed using vim.list_extend.
utils.list_insert_unique(opts.ensure_installed, "prettier")
end,
},
}

0 comments on commit 74473d8

Please sign in to comment.