How to generate etags for a huge project in Spacemacs on Windows

One of the first things I noticed when generating etags for a large project was that a huge TAGS file was being created. It made tag operations (like searching) slow in Emacs.

How can I generate a small tags file?

We can create a file that contains file paths, e.g.:

c:/myproject/file1.js
c:/myproject/lib/file2.js
c:/myproject/lib/file3.js

and then pass that file to ctags.exe, using the -L argument:

ctags.exe -e -L inputfiles.txt -f outputtags.txt

-e Generate Emacs tags -L Pass in a file containing file paths (that will be the input files for ctags.exe) -f The output tags file

This allows us to specify each file that will be tagged. If the project is really huge, we can even create separate tags files. The command above shows how to create a tags file with a different output filename.

Is there an easy way to create the input file?

I've written a Python script that searches directories (with optional filters) and creates a file containing the paths.

Comments

Leave a comment

What color are brown eyes? (spam prevention)
Submit
Code under MIT License unless otherwise indicated.
© 2020, Downranked, LLC.