RRethy / vim-illuminate

illuminate.vim - (Neo)Vim plugin for automatically highlighting other uses of the word under the cursor using either LSP, Tree-sitter, or regex matching.
2.23k stars 53 forks source link

Moving between references in macOS #190

Closed spring-haru closed 10 months ago

spring-haru commented 10 months ago

It is not a bug,,,,, The README.md says "You'll also get and as keymaps to move between references", and <a> is often interpreted as the option key in macOS. But, <option-n> and <option-p> do not work. Is this an expected result? What am I missing?

To Reproduce Use vim-illuminate and <option-n> and <option-p> in macOS.

Output from :IlluminateDebug None

Expected behavior Hopefully, <option-n> and <option-p> make it possible to jump other ref.

Screenshots None

Additional context None

macOS 14.2.1 nvim 0.9.5 Release

spring-haru commented 10 months ago

I decided to use

vim.keymap.set('n', '<C-n>', require('illuminate').goto_next_reference, { desc = "Move to next reference" })
vim.keymap.set('n', '<C-p>', require('illuminate').goto_prev_reference, { desc = "Move to previous reference" })

Thanks for a great plugin!

RRethy commented 10 months ago

I use MacOS, you likely already have a mapping for <a-n> and <a-p> which is causing vim-illuminate to not override that existing mapping, see the source code.