Skip to content

Instantly share code, notes, and snippets.

@Evizero
Last active September 22, 2022 00:49
Show Gist options
  • Save Evizero/e1595c35611c15ebf8f9 to your computer and use it in GitHub Desktop.
Save Evizero/e1595c35611c15ebf8f9 to your computer and use it in GitHub Desktop.
more comprehensive ctags definitions for the julia language based on the one in the official julia repository (inclusive vim tagbar)
--langdef=julia
--langmap=julia:.jl
--regex-julia=/^[ \t]*(abstract)[ \t]+([^ \t({[]+).*$/\2/a,abstract/
--regex-julia=/^[ \t]*(@with_kw[ \t]+)?(immutable)[ \t]+([^ \t({[]+).*$/\3/i,immutable/
--regex-julia=/^[ \t]*(@with_kw[ \t]+)?(type|typealias)[ \t]+([^ \t({[]+).*$/\3/t,type/
--regex-julia=/^[ \t]*(macro)[ \t]+([^ \t({[]+).*$/\2/m,macro/
--regex-julia=/^[ \t]*(@inline[ \t]+|@noinline[ \t]+)?(function)[ \t]+([^ \t({[]+)[^(]*\([ \t]*([^ \t;,=)({]+).*$/\3 (\4, …)/f,function/
--regex-julia=/^[ \t]*(@inline[ \t]+|@noinline[ \t]+)?(function)[ \t]+([^ \t({[]+)[^(]*(\([ \t]*\).*|\([ \t]*)$/\3/f,function/
--regex-julia=/^[ \t]*(@inline[ \t]+|@noinline[ \t]+)?(([^@#$ \t({[]+)|\(([^@#$ \t({[]+)\)|\((\$)\))[ \t]*(\{.*\})?[ \t]*\([ \t]*\)[ \t]*=([^=].*$|$)/\3\4\5/f,function/
--regex-julia=/^[ \t]*(@inline[ \t]+|@noinline[ \t]+)?(([^@#$ \t({[]+)|\(([^@#$ \t({[]+)\)|\((\$)\))[ \t]*(\{.*\})?[ \t]*\([ \t]*([^ \t;,=)({]+).*\)[ \t]*=([^=].*$|$)/\3\4\5 (\7, …)/f,function/
--regex-julia=/^[ \t]*(@defstruct)[ \t]+([^ \t({[]+).*$/\2/t,type/
--regex-julia=/^[ \t]*(@defimmutable)[ \t]+([^ \t({[]+).*$/\2/i,immutable/
let g:tagbar_type_julia = {
\ 'ctagstype' : 'julia',
\ 'kinds' : ['a:abstract', 'i:immutable', 't:type', 'f:function', 'm:macro']
\ }
@nico202
Copy link

nico202 commented May 27, 2016

Hi, can you get this working if the module is prepended? (like mymodule.myfunction())
I don't know if it's my emacs setup wrong
However, thanks for this :)

@goerz
Copy link

goerz commented Feb 3, 2018

I updated this a little bit for Julia 0.6: https://gist.github.com/goerz/4235572a3bc6adfaead06dc8b3c1826f

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