2024-07-11 15:32:22 +05:30
|
|
|
-- Customize None-ls sources
|
|
|
|
|
|
|
|
---@type LazySpec
|
|
|
|
return {
|
|
|
|
"nvimtools/none-ls.nvim",
|
|
|
|
opts = function(_, opts)
|
|
|
|
-- opts variable is the default configuration table for the setup function call
|
|
|
|
local null_ls = require "null-ls"
|
|
|
|
|
|
|
|
-- Check supported formatters and linters
|
|
|
|
-- https://github.com/nvimtools/none-ls.nvim/tree/main/lua/null-ls/builtins/formatting
|
|
|
|
-- https://github.com/nvimtools/none-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics
|
|
|
|
|
|
|
|
-- Only insert new sources, do not replace the existing ones
|
|
|
|
-- (If you wish to replace, use `opts.sources = {}` instead of the `list_insert_unique` function)
|
|
|
|
opts.sources = require("astrocore").list_insert_unique(opts.sources, {
|
|
|
|
-- Set a formatter
|
2024-09-15 21:55:18 +05:30
|
|
|
null_ls.builtins.formatting.stylua,
|
2024-07-11 15:32:22 +05:30
|
|
|
null_ls.builtins.formatting.prettier,
|
|
|
|
})
|
|
|
|
end,
|
|
|
|
}
|