If you are using Moose and Vim is your editor of choice then this might be of interest to you. The taglist plugin is very useful but it doesn't support Moose attributes out of the box. I just searched for a solution, found this and expanded it a bit.

Here is what I did to get attribute tags in the taglist plugin:
If it doesn't exist, create a file $HOME/.ctags with the following content:

--regex-perl=/^\s*has\s+['"]?([0-9a-zA-Z_]+)/\1/a,attribute/ --regex-perl=/^\s*with\s+(['"])(.+)\1/\2/r,role/ --regex-perl=/^\s*extends\s+(['"])(.+)\1/\2/e,extends/ --regex-perl=/^\s*use\s+([^ ;]+)/\1/u,use/
Only the first line is required to get the attributes. I also like to list the parent and role classes and all "used" classes, which is what the other lines do.

Then add to your $HOME/.vimrc:

let tlist_perl_settings='perl;u:use;p:package;r:role;e:extends;c:c +onstant;a:attribute;s:subroutine;l:label'
Remove the "u:use, r:role, e:extends" if you don't want them. I also found it useful to add:
let Tlist_Show_One_File = 1
So only the tags of the current file are shown.


In reply to Moose attributes as tags in Vim by tospo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.