feat(defaults): map "grx" to vim.lsp.codelens.run() #37689

Problem
Unlike inlay hints, code lenses are closely related to running commands;
a significant number of code lenses are used to execute a command (such
as running tests). Therefore, it is necessary to provide a default
mapping for them.

Solution
Add a new default mapping "grx" (mnemonic: "eXecute", like "gx").
This commit is contained in:
Yi Ming
2026-03-20 01:47:52 +08:00
committed by GitHub
parent e7684fb642
commit 06befe1e34
4 changed files with 8 additions and 2 deletions

View File

@@ -209,6 +209,10 @@ do
vim.lsp.buf.code_action()
end, { desc = 'vim.lsp.buf.code_action()' })
vim.keymap.set('n', 'grx', function()
vim.lsp.codelens.run()
end, { desc = 'vim.lsp.codelens.run()' })
vim.keymap.set('n', 'grr', function()
vim.lsp.buf.references()
end, { desc = 'vim.lsp.buf.references()' })