How to rewrite lsp keymaps for certain lang only? #3960
-
|
I want to add {
"pmizio/typescript-tools.nvim",
keys = {
{ "gD", ft = ft_js, "<cmd>TSToolsGoToSourceDefinition<cr>", desc = "TSTools: Goto Source Definition" },
},
config = true
}, |
Beta Was this translation helpful? Give feedback.
Answered by
dpetka2001
Jul 8, 2024
Replies: 1 comment 8 replies
-
|
It should just overwrite it, no? I just tested with |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ok I was wrong in my previous comment because I didn't have a json LSP server attached to the buffer that i tested, so the LSP mappings were not in effect and that's why it worked by mistake. You could try the following
{ "neovim/nvim-lspconfig", opts = function() local Keys = require("lazyvim.plugins.lsp.keymaps").get() vim.api.nvim_create_autocmd("LspAttach", { group = vim.api.nvim_create_augroup("js_keys", {}), desc = "JS keys", callback = function(ev) if vim.bo[ev.buf].filetype == "javascript" then vim.list_extend(Keys, { { "<leader>cR", false, }, …