Files
my-nvim/lua/crentist/lazy/lsp.lua
2025-06-19 18:27:08 +03:00

112 lines
3.1 KiB
Lua

return {
'neovim/nvim-lspconfig',
tag = 'v1.0.0',
dependencies = {
'williamboman/mason.nvim',
'williamboman/mason-lspconfig.nvim',
'saghen/blink.cmp',
'L3MON4D3/LuaSnip',
'j-hui/fidget.nvim',
'rafamadriz/friendly-snippets',
{ 'towolf/vim-helm', ft = 'helm' },
{
'folke/lazydev.nvim',
ft = 'lua', -- only load on lua files
opts = {
library = {
-- See the configuration section for more details
-- Load luvit types when the `vim.uv` word is found
{ path = '${3rd}/luv/library', words = { 'vim%.uv' } },
},
},
},
},
config = function()
vim.diagnostic.config({ virtual_text = false })
local lspconfig = require('lspconfig')
-- load snippets from friendly-snippets
require('luasnip.loaders.from_vscode').lazy_load()
require('fidget').setup({})
require('mason').setup({})
require('mason-lspconfig').setup({
automatic_installation = false,
-- Replace the language servers listed here
-- with the ones you want to install
ensure_installed = {
'ts_ls',
'lua_ls',
'gopls',
'pylsp',
'gitlab_ci_ls',
'yamlls',
'ansiblels',
'terraformls',
'helm_ls',
'marksman',
},
handlers = {
function(server_name)
local capabilities = require('blink.cmp').get_lsp_capabilities()
require('lspconfig')[server_name].setup({
capabilities = capabilities
})
end,
}
})
local pythonLineLength = 95
lspconfig.pylsp.setup {
settings = {
pylsp = {
plugins = {
autopep8 = {
enabled = false,
},
yapf = {
enabled = true,
},
pycodestyle = {
ignore = { 'W391' },
maxLineLength = pythonLineLength
}
}
}
}
}
lspconfig.ansiblels.setup {}
lspconfig.lua_ls.setup {}
lspconfig.helm_ls.setup {
settings = {
['helm-ls'] = {
yamlls = {
path = 'yaml-language-server',
}
}
}
}
lspconfig.yamlls.setup {}
lspconfig.helm_ls.setup {
settingsa = {
['helm-ls'] = {
yamlls = {
enabled = false
}
}
}
}
lspconfig.terraformls.setup {
filetypes = { 'terraform', 'terraform-vars', 'tf' }
}
end
}