Loading ...
Sorry, an error occurred while loading the content.

40529RE: Vim7: Listing the script where a map was defined

Expand Messages
  • Keith W. Roberts
    Sep 2, 2005
    • 0 Attachment
      > -----Original Message-----
      > From: Yegappan Lakshmanan [mailto:yegappanl@...]
      > Sent: Wednesday, August 31, 2005 3:41 PM
      > To: Zdenek.Sekera@...
      > Cc: Vim Developers
      > Subject: Re: Vim7: Listing the script where a map was defined
      > Hi,
      > On 8/31/05, Zdenek SEKERA <Zdenek.Sekera@...> wrote:
      > >
      > > 1. when I do e.g. ':verbose function', I get a very long listing of
      > > quite long lines that wrap around. e.g.: (just a short example):
      > >
      > > ...
      > > function Uname()
      > > Last set from
      > /afs/cern.ch/user/s/sekera/.vim/AsNeeded/Uname.vim
      > > ...
      > This is an existing behavior (in Vim 6.3 also). My patch didn't change
      > this. When using ":verbose function <name>", the body of the function
      > is also listed. The only change in Vim 7.0 is to display the script
      > where the function was defined. Currently this line is added after the
      > function heading and before the body of the function.
      > If this line is displayed at the end of the function, then
      > you may have to
      > scroll several screens (for large functions) to get to this
      > information.
      > - Yegappan

      Perhaps a tweak to the behavior of :function is in order. :map xx lists all
      maps starting with xx, and likewise for all the others. But :fun can
      comprise many, MANY lines, so how about adding an illegal function name
      character to indicate "just show me the function definition line, not the
      whole function".

      Something like
      :fun *Save
      to list just the definition lines of all functions starting with "Save".

      Hmmm... even better ... why not make it a pattern instead, as
      :fun /^Save.*

      :fun /.*text.*
      would list all functions [definition line(s) only] with names containing

      Consequently, :verbose fun /^Uname$ would list only the initial line of
      function Uname() in all the places it was previously defined.

      Or, I suppose you could make it act like :tag {ident}
      :h tag-regexp

    • Show all 23 messages in this topic