configured lsp plugins

This commit is contained in:
venus
2026-03-10 02:12:25 -05:00
parent d223037865
commit be84313c2c
8 changed files with 106 additions and 15 deletions

47
lua/config/lsp.lua Normal file
View File

@@ -0,0 +1,47 @@
-- lsp config
require('lspconfig')
local lsp_servers = {
'clangd',
'pyright',
'lua_ls',
}
for _, server in ipairs(lsp_servers) do
local config = {}
-- Special settings for Lua
if server == 'lua_ls' then
config.settings = {
Lua = {
diagnostics = {
-- Tell the language server that 'vim' is a global
globals = { 'vim' },
},
workspace = {
-- Make the server aware of Neovim runtime files
library = vim.api.nvim_get_runtime_file("", true),
checkThirdParty = false,
},
},
}
end
-- Apply the config and enable
vim.lsp.config(server, config)
vim.lsp.enable(server)
end
-- highlight error messages
vim.diagnostic.config({
virtual_text = {
prefix = '',
spacing = 4,
},
-- Show signs in the gutter (left side)
signs = true,
-- Underline the actual code that has the error
underline = true,
-- Don't update diagnostics while typing (keeps it less distracting)
update_in_insert = true,
-- Better looking border for float windows
float = { border = "rounded" },
})