Skip to content

Instantly share code, notes, and snippets.

@jbolila
Created November 22, 2013 10:48
Show Gist options
  • Save jbolila/7598018 to your computer and use it in GitHub Desktop.
Save jbolila/7598018 to your computer and use it in GitHub Desktop.
ctags for Modern Perl
--recurse=yes
--tag-relative=yes
--exclude=.git
--langmap=perl:+.pod
--regex-perl=/package[ \t]+['"]*([A-Za-z][A-Za-z0-9:]+)['" \t]*;/\1/p,package,packages/
--regex-perl=/with[ \t]+['"]*([A-Za-z][A-Za-z0-9:]+)['" \t]*;/\1/w,role,roles/
--regex-perl=/extends[ \t]+['"]*([A-Za-z][A-Za-z0-9:]+)['" \t]*;/\1/e,extends/
--regex-perl=/use[ \t]+base[ \t]+['"]*([A-Za-z][A-Za-z0-9:]+)['" \t]*;/\1/e,extends/
--regex-perl=/use[ \t]+parent[ \t]+['"]*([A-Za-z][A-Za-z0-9:]+)['" \t]*;/\1/e,extends/
--regex-perl=/^[ \t]*use[ \t]+['"]*([A-Za-z][A-Za-z0-9:]+)['" \t]*;/\1/u,use,uses/
--regex-perl=/^[ \t]*require[ \t]+['"]*([A-Za-z][A-Za-z0-9:]+)['" \t]*;/\1/r,require,requires/
--regex-perl=/^[ \t]*has[ \t]+['"]*([A-Za-z_+][A-Za-z0-9_]+)['"]*[ \t]+/\1/a,attribute,attributes/
--regex-perl=/^[ \t]*around[ \t]+['"]*([A-Za-z_][A-Za-z0-9_]+)['"]*[ \t]+/\1/x,around/
--regex-perl=/^[ \t]*\*([A-Za-z_][A-Za-z0-9:_]+)[ \t]+=/\1/l,alias,aliases/
--regex-perl=/^[ \t]*our[ \t]+([\$@%][A-Za-z_][A-Za-z0-9_]+)/\1/o,our,ours/
--regex-perl=/use[ \t]+constante[ \t]+['"]*([A-Za-z_][A-Za-z0-9_]+)['" \t]*/\1/c,constants/
--regex-perl=/^\=head1[ \t]+(.+)/\0/d,pod,Plain Old Documentation/
--regex-perl=/^\=head2[ \t]+(.+)/-- \1/d,pod,Plain Old Documentation/
--regex-perl=/^\=head[3-5][ \t]+(.+)/--- \1/d,pod,Plain Old Documentation/
-R
"..
Bundle 'vim-scripts/AutoTag'
Bundle 'majutsushi/tagbar'
"..
let g:tagbar_autoclose = 1
" Tagbar settings to recognise Perl Moo..Moose
let g:tagbar_type_perl = {
\ 'ctagstype' : 'Perl',
\ 'kinds' : [
\ 'p:packages:1:0',
\ 'u:uses:1:0',
\ 'r:requires:1:0',
\ 'e:extends',
\ 'w:roles',
\ 'o:ours:1:0',
\ 'c:constants:1:0',
\ 'f:formats:1:0',
\ 'a:attributes',
\ 's:subroutines',
\ 'x:around:1:0',
\ 'l:aliases',
\ 'd:pod:1:0',
\ ],
\ }
@jbolila
Copy link
Author

jbolila commented Nov 22, 2013

'vim-scripts/AutoTag' isn't required for this, not even the tagbar. Just the .ctags in $HOME for convenience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment