Skip to content

Instantly share code, notes, and snippets.

@dirkk
dirkk / xquery_vim
Created November 21, 2012 10:17
How to do nice XQuery coding in vim
1. Install Exuberant Ctags
2. Create ~/.ctags with the following content to (rudimentary) support XQuery for ctags:
--langdef=xquery
--langmap=xquery:.xq.xqm.xqy
--regex-xquery=/^[ \t]*declare?[ \t]*(%[^%])*[ \t]*function[ \n\t]*([_a-zA-Z0-9:-]*:)?([_a-zA-Z0-9-]+)/\3/f,function/
--regex-xquery=/^[ \t]*declare[ \t]*variable[ \t]*\$([_a-zA-Z0-9:-]*:)?([_a-zA-Z0-9-]+)/\2/v,variable/
--regex-xquery=/^module namespace[ \t]*(\w+)[ \t]*=.*/\1/m,module/
3. Install the Tlist vim plugin: vim-taglist.sourceforge.net