diff options
| author | Xander Swan <email> | 2025-12-03 10:00:41 -0500 |
|---|---|---|
| committer | Xander Swan <email> | 2025-12-03 10:00:41 -0500 |
| commit | ae7523c0c3cf8a04d35a7a448554e7b8d3a074f8 (patch) | |
| tree | e8fc0c29ed648b130501774fe045521b4786a97d /.config/nvim/lua/plugin/lsp.lua | |
| parent | ab57a70296890a7cbc4bb8b47e309e4857c6cd29 (diff) | |
Goodest nvim conf
Diffstat (limited to '.config/nvim/lua/plugin/lsp.lua')
| -rw-r--r-- | .config/nvim/lua/plugin/lsp.lua | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/.config/nvim/lua/plugin/lsp.lua b/.config/nvim/lua/plugin/lsp.lua new file mode 100644 index 0000000..1cce12f --- /dev/null +++ b/.config/nvim/lua/plugin/lsp.lua @@ -0,0 +1,48 @@ +local lsp = require("lsp-zero") +local lspconfig = require("lspconfig") + +lsp.preset("recommended") + +lsp.ensure_installed { + "lua_ls", + "clangd", + "cmake", + "rust_analyzer", +} + +lspconfig.gdscript.setup {} + +local cmp = require("cmp") +local cmp_select = { behavior = cmp.SelectBehavior.Select } +local cmp_mappings = lsp.defaults.cmp_mappings { + ["<down>"] = cmp.mapping.select_next_item(cmp_select), + ["<up>"] = cmp.mapping.select_prev_item(cmp_select), + ["<C-a>"] = cmp.mapping.confirm({ select = true }), + ["<CR>"] = cmp.mapping.confirm({ select = true }), +} + +lsp.setup_nvim_cmp { + mapping = cmp_mappings +} + +lsp.set_preferences { + suggest_lsp_servers = false, + sign_icons = { + error = "E", + warn = "W", + hint = "H", + info = "I", + } +} + +lsp.on_attach(function(_, buffer) + local opts = { buffer=buffer, remap=false } + + vim.keymap.set("n", "<leader>ld", function() vim.lsp.buf.definition() end, opts) +end) + +lsp.setup() + +vim.diagnostic.config { + virtual_text = true +} |
