Going beyond the :map command and finding out in what file keymaps are declared...

I'm trying to add a few more keymaps for some builtin telescope functions. Ironically, builtin.keymaps being one of them.

Which key shows my other telescope keymaps when I type <leader>f, but I want to figure out where they are defined. Is there a command in neovim to find where the keymaps are declared?

stevearc,

You can see where your keymaps were set with :verbose map, or :verbose nmap for all your normal maps, or :verbose nmap <leader>f for all your normal maps that start with <leader>f. Note that if your keymap was set from lua you will only see "Last set from lua". To get where in lua, you'll need to start Neovim in verbose mode nvim -V1. See :help verbose-cmd for more information.

normanras, (edited )

No way! Is this the same stevearc that made vim-arduino plugin? I was about to open an issue on the repo! But it might just be my setup of the lazy plugin manager.

Anyway, thanks for the tip here! Since so much is setup with Lua the command just says "Last set by Lua". I'll have to dig around some more.

stevearc,

Yep that's me, issues welcome 🙂

This is why I mentioned starting in verbose mode nvim -V1. If you do that you should see the exact line number where the keymap was set from lua.

normanras,

Embarrassing... a little extra reading would have solved my issue. Thanks again, Steve!

  • All
  • Subscribed
  • Moderated
  • Favorites
  • neovim@open-source.social
  • kavyap
  • thenastyranch
  • GTA5RPClips
  • tester
  • InstantRegret
  • DreamBathrooms
  • ngwrru68w68
  • magazineikmin
  • everett
  • Youngstown
  • mdbf
  • slotface
  • rosin
  • cisconetworking
  • megavids
  • khanakhh
  • normalnudes
  • osvaldo12
  • cubers
  • tacticalgear
  • Durango
  • ethstaker
  • modclub
  • anitta
  • provamag3
  • Leos
  • JUstTest
  • lostlight
  • All magazines