diff options
| author | filip <“filip.rabiega@gmail.com”> | 2026-02-14 22:40:01 +0100 |
|---|---|---|
| committer | filip <“filip.rabiega@gmail.com”> | 2026-02-14 22:40:01 +0100 |
| commit | 5be4048246def725c11499c8cff8f77da4cd47c4 (patch) | |
| tree | 7bd62e82c66e4a94a93db73810fa37b1f38c6306 /lspconfig.lua | |
| parent | 49f248ea71b796d44c5080926f31f585d910f66c (diff) | |
| download | lazy-plugins-5be4048246def725c11499c8cff8f77da4cd47c4.tar.gz lazy-plugins-5be4048246def725c11499c8cff8f77da4cd47c4.tar.bz2 lazy-plugins-5be4048246def725c11499c8cff8f77da4cd47c4.zip | |
fix stuff
Diffstat (limited to 'lspconfig.lua')
| -rw-r--r-- | lspconfig.lua | 37 |
1 files changed, 26 insertions, 11 deletions
diff --git a/lspconfig.lua b/lspconfig.lua index 1184af8..9827b2d 100644 --- a/lspconfig.lua +++ b/lspconfig.lua @@ -1,12 +1,19 @@ return { "neovim/nvim-lspconfig", - dependencies = { "williamboman/mason.nvim" }, + dependencies = { + "williamboman/mason.nvim", + "williamboman/mason-lspconfig.nvim", + }, config = function() - -- Define the configuration for pyright using the native API + -- Mason + require("mason").setup() + + require("mason-lspconfig").setup({ + ensure_installed = { "pyright", "clangd" }, + }) + + -- Pyright vim.lsp.config("pyright", { - cmd = { "pyright-langserver", "--stdio" }, - filetypes = { "python" }, - root_markers = { "pyproject.toml", "setup.py", "requirements.txt", ".git" }, settings = { python = { analysis = { @@ -17,12 +24,20 @@ return { }, }) - -- Trigger the server start for python files - vim.api.nvim_create_autocmd("FileType", { - pattern = "python", - callback = function(args) - vim.lsp.start("pyright") - end, + -- Clangd + vim.lsp.config("clangd", { + cmd = { + "clangd", + "--background-index", + "--clang-tidy", + "--header-insertion=never", + "--completion-style=detailed", + "--function-arg-placeholders", + }, }) + + -- Enable servers + vim.lsp.enable("pyright") + vim.lsp.enable("clangd") end, } |
