Monday, July 2, 2012

Re: finding the originating map command

* Gary Johnson <garyjohn@spocom.com> [120702 15:29]:
> On 2012-07-02, Tim Johnson wrote:
>
> I don't think Vim remembers any place but the last where a mapping
> was defined. However, you can start Vim like this,
>
> $ vim -V15verbose.out ...
>
> and capture all the ex commands to the file verbose.out. Then you
> can open that file and search for
>
> map\s\+,cs\>
>
> or filter verbose.out with something like this
>
> $ grep 'map[^I ][^I ]*,cs\>\|^[^l]' verbose.out | grep -C2 map
>
> to find the various places where that mapping was defined. Those ^I
> pairs are literal tabs. The "\|^[^l]" is there to capture all the
> lines saying what file is being sourced, function being called,
> etc., without all the lines beginning with "line " other than the
> one(s) defining your mapping.
>
> > 2)Find where a function originated
> > i.e. where is CheckSyntax defined?
>
> :verbose function CheckSyntax
>
> will tell you where the function was last defined.
That is great Gary, thanks for such a succint solution.
cheers
--
Tim
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: