From 10d346ca1210dd563badb7e15781d76bb616665c Mon Sep 17 00:00:00 2001 From: siduck Date: Wed, 2 Oct 2024 09:08:09 +0530 Subject: [PATCH] add note about lspmappings --- src/routes/docs/config/mappings.mdx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/routes/docs/config/mappings.mdx b/src/routes/docs/config/mappings.mdx index f8f36f01..286ef19a 100644 --- a/src/routes/docs/config/mappings.mdx +++ b/src/routes/docs/config/mappings.mdx @@ -42,4 +42,20 @@ nomap("n", "")
- Do know that lsp mappings wont be overrided by the above methods, because they dont load on startup & are lazy loaded. -- So put the lsp ones in `LspAttach` autocmd or right after your on_attach +- So put the lsp ones in a custom on_attach function + +```lua +local ooo = function(client, bufnr) + nvlsp.on_attach(client, bufnr) + -- map HERE + vim.keymap.set("n", "gd", " Telescope", { buffer = bufnr }) +end + +for _, lsp in ipairs(servers) do + lspconfig[lsp].setup { + on_attach = nvlsp.on_attach, + on_init = ooo, + capabilities = nvlsp.capabilities, + } +end +```