Skip to content

Instantly share code, notes, and snippets.

@milanglacier
milanglacier / gist:72a3ca7b9fb55ab18e23aee1b33cf480
Last active November 12, 2022 22:14
Customized Ctags syntax for parsing R and Pandas data frame columns
# put the following under ~/.ctags.d/options.ctags, don't include this line into ~/.ctags.d/options.ctags
--langdef=Rext{base=R}
--kinddef-Rext=v,variable,a variable with named attr
--kinddef-Rext=n,nameattr,the named attributes of a variable
--_roledef-Rext.v=nondefinition,this is not a definition
--regex-Rext=/([[:alnum:]_.]+)\$[[:alnum:]_.]+\s*(<-|=)[^=]/\1/v/{scope=push}{_role=nondefinition}
--regex-Rext=/[[:alnum:]_.]+\$([[:alnum:]_.]+)\s*(<-|=)[^=]/\1/n/{scope=ref}
--regex-Rext=/[[:alnum:]_.]+\$[[:alnum:]_.]+\s*(<-|=)[^=].*///{scope=pop}{placeholder}