feat: add null-ls to auto-format with prettier

This commit is contained in:
Michael Mandl 2022-05-18 16:20:47 +02:00
parent 415fcc08ae
commit 49a05c0306
Signed by: mandlm
GPG key ID: 4AA25D647AA54CC7

View file

@ -132,6 +132,25 @@ return require('packer').startup(function(use)
config = function() require('plugins.nvim-lsp-setup') end, config = function() require('plugins.nvim-lsp-setup') end,
} }
-- null-ls
use {
"jose-elias-alvarez/null-ls.nvim",
requres = {
{ "nvim-lua/plenary.nvim" },
},
config = function()
require("null-ls").setup({
sources = {
require("null-ls").builtins.formatting.prettier,
},
on_attach = function(client)
local utils = require("nvim-lsp-setup.utils")
utils.format_on_save(client)
end,
})
end,
}
-- treesitter -- treesitter
use({ use({
'nvim-treesitter/nvim-treesitter', 'nvim-treesitter/nvim-treesitter',