Skip to content

how to remap default gx and gr to <leader>gx <leader>gr #1458

Closed Answered by echasnovski
yxian9 asked this question in Q&A
Discussion options

You must be logged in to vote

Here is how I remap built-in gx.

The gr mapping for "go to reference" may vary for you. Chances are, you mean map to vim.lsp.buf.references() which can be done as a usual mapping. I prefer something like this: vim.keymap.set('n', '<Leader>gr', '<Cmd>lua vim.lsp.buf.references()<CR>', { desc = 'References' }).

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by echasnovski
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested mini.operators
2 participants