Closed escapingSamsara closed 7 months ago
EDIT: Seems like i fixed it by going through the docs again and using the described lsp-keymap method (https://www.lazyvim.org/plugins/lsp)
this is the code i added in order to make it work for now:
--/plugins/nvim-lsp.lua
return {
-- LSP keymaps
{
"neovim/nvim-lspconfig",
init = function()
local keys = require("lazyvim.plugins.lsp.keymaps").get()
-- disable a keymap
keys[#keys + 1] = { "<leader>cc", false } --disable default lsp.codelens.run keymap
keys[#keys + 1] = { "<leader>cC", false } --disable default lsp.codelens.refresh
-- add a new keymap
keys[#keys + 1] = { "<leader>cl", "vim.lsp.codelens.run" }
keys[#keys + 1] = { "<leader>cL", "vim.lsp.codelens.refresh" }
end,
},
}
Why have you reopened this issue then?
Hey there !
I re-opened it because i hope for an answer regarding if this is the envisioned and correct way to do this. A fix is not a fix if it's a dirty one.
I am currently customizing my lazyvim starter setup a little bit and for that i added chatgpt.nvim.
In order to use it the way i want it i was adding which-key descriptions in order to use it and also have a reference.
I, for my needs wanted to use chatgpt by mapping it toc in order to open the menu for the different commands, for which i want to use these mappings:
the issue that evolved is thatc is already a predefined command (opening the +code keymappings), and oddly, i just cant remap cc to run chatgpt, it always runs codeLens (which is the default action that runs when using this keybind). although i remapped codelens in my keymaps to another command (cl) and also remapped other commands conflicting with the way i want to use chatgpt.
here is my current keymaps.lua file (showing the changed snippets):
why does this way not overwrite the codelens keymaps, while on the other hand successfully remappingci to show LspInfo (default = cl).
Do i need to change the codelens keymaps somewhere else or am i doing something wrong in remapping it?