nvim: Configure Black for Python formatting
This commit is contained in:
parent
adc48d9506
commit
f1d3d5eeb7
1 changed files with 7 additions and 0 deletions
|
|
@ -549,6 +549,12 @@ local lsp_settings = {
|
||||||
tsserver = {},
|
tsserver = {},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local null_ls_sources = {
|
||||||
|
null_ls.builtins.formatting.black,
|
||||||
|
-- Prettier is done with MunifTanjim/prettier.nvim which runs with
|
||||||
|
-- project-local settings.
|
||||||
|
}
|
||||||
|
|
||||||
-- In theory, this can be used for all languages. In practice, I just need this
|
-- In theory, this can be used for all languages. In practice, I just need this
|
||||||
-- to pretend that gopls will run goimports for me.
|
-- to pretend that gopls will run goimports for me.
|
||||||
function goimports(wait_ms, opts)
|
function goimports(wait_ms, opts)
|
||||||
|
|
@ -591,6 +597,7 @@ for _, server in ipairs(lsp_installer.get_installed_servers()) do
|
||||||
|
|
||||||
null_ls.setup({
|
null_ls.setup({
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
|
sources = null_ls_sources,
|
||||||
})
|
})
|
||||||
|
|
||||||
::continue::
|
::continue::
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue