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:
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.--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/
Then add to your $HOME/.vimrc:
Remove the "u:use, r:role, e:extends" if you don't want them. I also found it useful to add:let tlist_perl_settings='perl;u:use;p:package;r:role;e:extends;c:c +onstant;a:attribute;s:subroutine;l:label'
So only the tags of the current file are shown.let Tlist_Show_One_File = 1
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Moose attributes as tags in Vim
by Anonymous Monk on Aug 31, 2010 at 15:45 UTC | |
by tospo (Hermit) on Sep 01, 2010 at 13:51 UTC |