Behold ntagger.
ntagger is a small Nim tool that generates universal-ctags–compatible tag files for Nim projects by reusing the Nim compiler's own parser and AST. It can be used both as a CLI (producing a tags stream on stdout or in a file) and as a library via generateCtagsForDir.
I've been trying out neovim for a bit and wanted at least some old school tag matching for Nim. The current ones didn't fit my needs or were broken (including Nim own nim ctags command).
Basic usage matches ctags: ntagger -f tags. There's a special mode just for Atlas as well ntagger --atlas that makes a deps/tags file as well.
Processing ctags for the entire Nim stdlib takes about 0.5 seconds on my machine:
-> % time ntagger --system -f tags
/Users/elcritch/.local/share/grabnim/nim-2.2.6/lib/system/gc_ms.nim(339, 41) Warning: Number of spaces around '+%' is not consistent [Spacing]
ntagger --system -f tags 0.50s user 0.05s system 99% cpu 0.555 totalLooking forward to using this but had a small hiccup on the way :-)
Posted the following in the Github issues
Date: 02-Dec-25 OS: OSX Sonoma
Nim version:
nim -v Nim Compiler Version 2.2.6 [MacOSX: amd64] Compiled at 2025-11-03 Copyright (c) 2006-2025 by Andreas Rumpf
active boot switches: -d:release
Using the default zsh shell:
nimble install https://github.com/elcritch/ntagger
Produces the following error:
Warning: The compiler package has been renamed to nim
- Building ntagger/ntagger using c backend
- Info: compiling nim package using /Users/dennismisener/.nimble/pkgs2/nim-2.0.8-46333e8f4bda41dd6d3852a3f5fa4975b96b66a2/bin/nim
- Nim Output /Users/dennismisener/.nimble/pkgcache/githubcom_elcritchntagger/ntagger.nim(56, 42) Error: undeclared identifier: 'nkOpenSym'
- ... candidates (edit distance, scope distance); see '--spellSuggest': ... (1, 5): 'nfOpenSym'
- Building ntagger/ntagger using c backend
- Info: compiling nim package using /Users/dennismisener/.nimble/pkgs2/nim-2.0.8-46333e8f4bda41dd6d3852a3f5fa4975b96b66a2/bin/nim
- Nim Output /Users/dennismisener/.nimble/pkgcache/githubcom_elcritchntagger_#head/ntagger.nim(56, 42) Error: undeclared identifier: 'nkOpenSym'
- ... candidates (edit distance, scope distance); see '--spellSuggest': ... (1, 5): 'nfOpenSym'
- Tip: 11 messages have been suppressed, use --verbose to show them.
nimble.nim(419) buildFromDir
Error: Build failed for the package: ntagger
--useSystemNim fix it?
There's some lock file in nimble that defaults to that version of nim. Which really sucks because that version fails to compile alot of nimble packages.
Version v0.4.0 is out!
ntagger now supports a flag to export private items in addition to public ones. The CLI also supports single file inputs. It also support multiple files/directories as well, with the caveat that overlapping inputs will make duplicate tags.
Now installs like a like a charm.. Thanks for the --useSystemNim switch int.
Although that warning is a little distracting:
nimble install --useSystemNim https://github.com/elcritch/ntagger
Warning: The compiler package has been renamed to nim
Building ntagger/ntagger using c backend
Info: compiling nim package using /Users/dennismisener/.nimble/bin/nim
Nim Output /Users/dennismisener/.nimble/pkgcache/githubcom_elcritchntagger/ntagger.nim(341, 17)
Warning: use readLines with two arguments; readLines is deprecated [Deprecated]
Warning: Symlink already exists in /Users/dennismisener/.nimble/bin/ntagger. Replacing.
My primary interest was originally to use it with the Zed text editor because the nimlangserver was giving me woes... but in trying to configure ctag-lsp it started working!!... .
Any advantages or application outside Zed navigation shortcuts I might be missing?
Any advantages or application outside Zed navigation shortcuts I might be missing?
Not really? Well aside from reliability and it being super fast location lookups. I made it mainly for vim/neovim cause it understands ctags by default with keybindings.
I'd like to use nimlangserver but it uses nimsuggest which crashes enough that I get tired of it.
Though using grabnim instead of choosenim does seem to let nimlangserver properly kill bad nimsuggest processes! It's much better with that so I don't bother uninstalling nimlangserver now.
I managed to get ntagger working with GNOME Builder using a small patch: https://copr.fedorainfracloud.org/coprs/planetis/gnome-builder-nim/. This is a Builder package for Fedora that also disables Flatpak support.
Go to Preferences -> Editor -> Code Completions and change the Ctags path to something like:
~/.nimble/bin/ntagger --private