# Ctags for zig

**URL:** <https://ziggit.dev/t/ctags-for-zig/8264>\
**Category:** Help\
**Tags:** tools\
**Created:** [January 30, 2025, 7:01pm UTC](https://ziggit.dev/t/ctags-for-zig/8264 "2025-01-30T19:01:53Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![mg979](https://ziggit.dev/letter_avatar_proxy/v4/letter/m/3e96dc/32.png) [@mg979](https://ziggit.dev/u/mg979)\
**Post date:** [July 27, 2025, 2:56pm UTC](https://ziggit.dev/t/ctags-for-zig/8264/10 "2025-07-27T14:56:54Z")

</div>

If you don’t mind something simpler, you can put this in `~/.config/ctags/zig.ctags`:

```zig
--langdef=zig
--map-zig=.zig

--kinddef-zig=f,function,functions
--kinddef-zig=m,method,methods
--kinddef-zig=t,type,types
--kinddef-zig=v,field,fields

--regex-zig=/^(export +)?(pub +)?(inline +)?fn +([a-zA-Z0-9_]+)/\4/f/{exclusive}
--regex-zig=/^(export +)?(pub +)?[\t]*const +([a-zA-Z0-9_]+) = (struct|enum|union)/\3/t/{exclusive}{scope=push}
--regex-zig=/^}///{exclusive}{scope=pop}{placeholder}
--regex-zig=/^[\t]+(pub +)?(inline +)?fn +([a-zA-Z0-9_]+)/\3/m/{exclusive}{scope=ref}
--regex-zig=/^(export +)?pub +const +([a-zA-Z0-9_]+)(:.*)? = .*/\2/v/{exclusive}

```

---

_[View the full topic](https://ziggit.dev/t/ctags-for-zig/8264)._
