Public Access
36 lines
775 B
Lua
36 lines
775 B
Lua
return {
|
|
"nvimtools/none-ls.nvim",
|
|
dependencies = {
|
|
"nvimtools/none-ls-extras.nvim",
|
|
},
|
|
config = function()
|
|
local null_ls = require("null-ls")
|
|
local formatting = null_ls.builtins.formatting
|
|
|
|
local prettypst = {
|
|
name = "prettypst",
|
|
method = require("null-ls").methods.FORMATTING,
|
|
filetypes = { "typst" },
|
|
generator = require("null-ls.helpers").formatter_factory({
|
|
command = vim.fn.stdpath("data") .. "/mason/bin/prettypst",
|
|
args = { "-" },
|
|
to_stdin = true,
|
|
}),
|
|
}
|
|
|
|
null_ls.setup({
|
|
sources = {
|
|
formatting.stylua,
|
|
formatting.black,
|
|
formatting.isort,
|
|
formatting.prettier.with({
|
|
extra_filetypes = { "svelte" },
|
|
}),
|
|
prettypst,
|
|
},
|
|
})
|
|
|
|
vim.keymap.set("n", "<leader>gf", vim.lsp.buf.format, {})
|
|
end,
|
|
}
|