summaryrefslogtreecommitdiff
path: root/lua/plugins/lsp.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/plugins/lsp.lua')
-rw-r--r--lua/plugins/lsp.lua24
1 files changed, 24 insertions, 0 deletions
diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua
new file mode 100644
index 0000000..e0340bd
--- /dev/null
+++ b/lua/plugins/lsp.lua
@@ -0,0 +1,24 @@
+return {
+ "neovim/nvim-lspconfig",
+ opts = {
+ servers = {
+ clangd = {},
+ ocamllsp = {},
+ pylsp = {}
+ }
+ },
+ config = function(_, opts)
+ local lspconfig = require("lspconfig")
+ local on_attach = function(client, bufnr)
+ local opts = { buffer = bufnr }
+ vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
+ vim.keymap.set("n", "<leader>cr", vim.lsp.buf.rename, opts)
+ end
+ for server, config in pairs(opts.servers) do
+ config.on_attach = on_attach
+ config.capabilities = require("blink.cmp").get_lsp_capabilities(config.capabilities)
+ vim.lsp.config(server, config)
+ vim.lsp.enable(server)
+ end
+ end
+}