Pages

About Me

My Photo
My Blogs reflect something of me

Wednesday, July 13, 2011

Browsing XSLT with Vim by adding a Custom Language to Ctags

XSLT Source Code Browsing with Vim and Ctags

Creating a tags file

1) Test out the regular-expressions for your custom language:
$> egrep 'pattern' *.xsl
2) Copy-paste custom language with the above regular-expressions into ~/.ctags.
$> vi ~/.ctags
--langdef=EXSLT
--langmap=EXSLT:.xsl
--regex-EXSLT=/--regex-EXSLT=/--regex-EXSLT=/$> cd srcdir
$> ctags -R *
$> vi ./tags        #check for tag-entries containing the search patterns
$> vi test.xsl     #Use Ctrl-] to jump from a pattern usage to its definition, Ctrl-T to jump back
Note:
1) Above solution for templates only uses xpath of match="xyz".
The search-key for the template (displays taglist for templates with same xpath).
Potentially a template is uniquely identifiable using match AND mode:

No comments:

Post a Comment