Skip to content

Commit

Permalink
add note about lspmappings
Browse files Browse the repository at this point in the history
  • Loading branch information
siduck committed Oct 2, 2024
1 parent 23fd75f commit 10d346c
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/routes/docs/config/mappings.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,20 @@ nomap("n", "<C-k>")
<br/>

- 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", "<cmd> Telescope<cr>", { buffer = bufnr })
end

for _, lsp in ipairs(servers) do
lspconfig[lsp].setup {
on_attach = nvlsp.on_attach,
on_init = ooo,
capabilities = nvlsp.capabilities,
}
end
```

0 comments on commit 10d346c

Please sign in to comment.