python black

This commit is contained in:
Piotr Domański 2024-07-21 12:14:42 +02:00
parent 98f46a60fd
commit a5d56bdc85

View file

@ -66,7 +66,6 @@ return {
})
end,
},
-- LSP
{
"neovim/nvim-lspconfig",
@ -78,34 +77,44 @@ return {
{ "williamboman/mason.nvim" },
},
config = function()
local lsp = require("lsp-zero")
lsp.ensure_installed(
{
require('mason').setup({})
require('mason-lspconfig').setup({
-- Replace the language servers listed here
-- with the ones you want to install
ensure_installed = {
"lua_ls",
"gopls",
"pylsp",
"tsserver",
},
handlers = {
function(server_name)
require('lspconfig')[server_name].setup({})
end,
}
)
})
local lsp = require("lsp-zero")
lsp.on_attach(function(client, bufnr)
lsp.default_keymaps({ buffer = bufnr })
end)
local read_exec_path = function(exec_name)
local handle = io.popen("which " .. exec_name)
local result = handle:read("*a"):gsub("\n", "")
handle:close()
return result
end
local nvim_lsp = require("lspconfig")
nvim_lsp = require("lspconfig")
nvim_lsp.lua_ls.setup(lsp.nvim_lua_ls())
nvim_lsp.gopls.setup({})
nvim_lsp.dartls.setup({})
nvim_lsp.pylsp.setup({})
nvim_lsp.tsserver.setup({})
nvim_lsp.pylsp.setup({
settings = {
pylsp = {
plugins = {
black = { enabled = true },
isort = { enabled = true, profile = "black" },
},
},
},
})
lsp.setup()
end,