Find where anything is defined in Vim config
When your vim bundle and vimrc become a plugin soup you often need to debug where an autocmd
, command
, map
or function
are coming from.
The :verbose
command can come in handy in this scenario. Here are some examples:
See where a mapping was set from:
:verbose map gY
See what happens when you enter a buffer:
:verbose autocmd BufEnter
See which file defined a command:
:verbose command Explore
Where is the abbreviation coming from:
:verbose abbrev bpry
etc...
Example output:
Name Args Address Complete Definition
! Explore * 0c dir call netrw#Explore(<count>,0,0+<bang>0,<q-args>)
Last set from /usr/local/Cellar/vim/7.4.1190/share/vim/vim74/plugin/netrwPlugin.vim
Happy hunting! 🔫
Tweet