You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
localnull_ls_status_ok, null_ls=pcall(require, "null-ls")
ifnotnull_ls_status_okthenreturnend-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formattinglocalformatting=null_ls.builtins.formatting-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnosticslocaldiagnostics=null_ls.builtins.diagnosticslocalaugroup=vim.api.nvim_create_augroup("LspFormatting", {})
null_ls.setup({
debug=false,
sources= {
formatting.prettier.with({ extra_args= { "--no-semi", "--single-quote", "--jsx-single-quote" } }),
formatting.black.with({ extra_args= { "--fast" } }),
formatting.stylua,
-- diagnostics.flake8
},
-- you can reuse a shared lspconfig on_attach callback hereon_attach=function(client, bufnr)
ifclient.supports_method("textDocument/formatting") thenvim.api.nvim_clear_autocmds({ group=augroup, buffer=bufnr })
vim.api.nvim_create_autocmd("BufWritePre", {
group=augroup,
buffer=bufnr,
callback=function()
-- on 0.8, you should use vim.lsp.buf.format({ bufnr = bufnr }) insteadvim.lsp.buf.formatting_sync()
end,
})
endend,
})
every time save file i should the correct server (capture bellow), question how can i save and nvim know the correct server, mean i don't need every time choose manually the server ??
The text was updated successfully, but these errors were encountered:
that my config of null-ls:
every time save file i should the correct server (capture bellow), question how can i save and nvim know the correct server, mean i don't need every time choose manually the server ??
The text was updated successfully, but these errors were encountered: