Dotfiles/nvim/lua/plugins/code-lsp-extra.lua
2024-02-24 20:53:17 +01:00

40 lines
993 B
Lua

return {
"nvimtools/none-ls.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
},
config = function()
-- Setup --
local null_ls = require("null-ls")
null_ls.setup({
sources = {
-- Prettier --
null_ls.builtins.formatting.prettier,
-- Php --
null_ls.builtins.diagnostics.phpstan,
null_ls.builtins.formatting.phpcsfixer.with({
prefer_local = "vendor/bin/php-cs-fixer",
args = {"fix", "--allow-risky=yes", "$FILENAME"}
}),
-- Twig --
null_ls.builtins.diagnostics.twigcs,
-- JavaScript & Typescript
null_ls.builtins.formatting.eslint_d,
-- Lua --
null_ls.builtins.formatting.stylua,
-- Go --
null_ls.builtins.formatting.gofumpt,
null_ls.builtins.code_actions.gomodifytags,
null_ls.builtins.code_actions.impl
},
})
-- Keybinding --
vim.keymap.set("n", "<leader>gf", vim.lsp.buf.format, {})
end,
}