change nulls config

This commit is contained in:
vincent 2022-06-19 14:53:21 +02:00
parent 709eb50b14
commit a1540206c4

View File

@ -284,30 +284,46 @@ return require('packer').startup {
end end
} }
use({'jose-elias-alvarez/null-ls.nvim', -- use({'jose-elias-alvarez/null-ls.nvim',
config= function() -- config= function()
require("null-ls").setup({ -- local lsp_formatting = function(bufnr)
on_attach = function(client) -- vim.lsp.buf.format({
if client.resolved_capabilities.document_formatting then -- filter = function(clients)
vim.cmd([[ -- -- filter out clients that you don't want to use
augroup LspFormatting -- return vim.tbl_filter(function(client)
autocmd! * <buffer> -- return client.name ~= "gopls"
autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_sync() -- end, clients)
augroup END -- end,
]]) -- bufnr = bufnr,
end -- })
end, -- end
sources = { --
require("null-ls").builtins.formatting.prettier, -- -- if you want to set up formatting on save, you can use this as a callback
require("null-ls").builtins.formatting.trim_whitespace, -- local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
require("null-ls").builtins.formatting.trim_newlines, --
require("null-ls").builtins.formatting.black, -- require("null-ls").setup({
require("null-ls").builtins.diagnostics.eslint, -- on_attach = function(client,bufnr)
require("null-ls").builtins.completion.spell, -- if client.supports_method("textDocument/formatting") then
}, -- vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
}) -- vim.api.nvim_create_autocmd("BufWritePre", {
end}) -- group = augroup,
-- buffer = bufnr,
-- callback = function()
-- lsp_formatting(bufnr)
-- end,
-- })
-- end
-- end,
-- sources = {
-- require("null-ls").builtins.formatting.prettier,
-- require("null-ls").builtins.formatting.trim_whitespace,
-- require("null-ls").builtins.formatting.trim_newlines,
-- require("null-ls").builtins.formatting.black,
-- require("null-ls").builtins.diagnostics.eslint,
-- },
-- })
-- end})
--
-- File manager -- File manager
use({ use({
"kyazdani42/nvim-tree.lua", "kyazdani42/nvim-tree.lua",