I'd like to know if there is an analogue to verbose map <key> (which shows the location that the map was assigned) for functions. For example I have a few Git plugins and I'd like to know what plugin defines the :GitFiles function, if Vim knows this info.

The fallback (which'll certainly work) is to search my files for the string.


From :h :function-verbose:

When 'verbose' is non-zero, listing a function will also display where it was
last defined. Example: >

    :verbose function SetFileTypeSH
    function SetFileTypeSH(name)
        Last set from /usr/share/vim/vim-7.0/filetype.vim

So :verbose function GitFiles should do the work.

  • 4
    or to know where a command was defined: :verbose :com GitFiles Sep 25 '19 at 17:19
  • the :com option worked for me, thanks Dec 13 '20 at 6:34

While the other answer is correct, you can take another approach: install https://github.com/iamcco/coc-vimlsp and use go to definition feature of coc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.