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

68896Re: [Patch] Refine listed tags with regex

Expand Messages
  • Lech Lorens
    Mar 29, 2013
      On 29-Mar-2013 Cody Cutler <ccutler@...> wrote:
      > Hello list. The attached patch allows optional regexs to be passed to
      > :tj and friends. these regexs is then used to further refine available
      > tags before they are printed.
      > This patch is useful when you have many tags for a single identifier.
      > For example, suppose a large C++ project has initialize() methods for
      > 100s of classes. Going through the list of tags printed by :tj is
      > tedious. Most of the time I know additional information about the
      > identifier I am looking for like the containing object type or source
      > filename. The text after the '/' in the argument is used as a regex
      > (unless a '/' is the first character of the tag identifier, then the
      > text after the second '/' is used) to match against the "other" tag
      > fields (which often contains the containing type name). If a '!' is
      > present, text after it is used to match against filenames. With this
      > patch you can type:
      > :tj initialize/SomeClass
      > to list all tags that also contain "SomeClass" in their "other" fields
      > or
      > :ts initialize/!arch/amd64
      > to list all tags matching initialize that contain "arch/amd64" in the
      > containing file's pathname. Or a mix:
      > :ts initialize/SomeClass!arch/amd64
      > The '/' and '!' characters were chosen somewhat arbitrarily--I'm not
      > sure if they are a safe choice.
      > Any comments are appreciated.

      I haven't tested your patch but it reminds me of a patch I prepared some
      2 years ago. You could search the list archives for a feature called
      'tagfunc' which with the awesome SmartTag vim script by Robert Webb I've
      been happily using ever since.


      You received this message from the "vim_dev" 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

      You received this message because you are subscribed to the Google Groups "vim_dev" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Show all 5 messages in this topic