Want to be able to search for symbols in your source code? You can index your source code and search it quickly with Exuberant Ctags. There are 41 languages supported.
Navigate to the ctags page.
Download the zip file:
Extract the folder:
Move the folder to a location of your choice. In the folder you should see ctags.exe:
If you want, add the directory (e.g. c:/ctags) to your system path (example here).
Let's tell Spacemacs how to create these tags. Add the following line to the user-config section of your .spacemacs file:
(setq projectile-tags-command "c:\\ctags\\ctags.exe -R -e")
The -R is for recursive (scan sub-directories) and the -e is for creating Emacs tags.
Restart Spacemacs to finalize this configuration.
We're going to generate tags for a project under a certain directory. If you haven't already, make sure you've created a project.
We can generate tags from within Spacemacs. Open a file inside your project's directory, and press SPACE p G:
You should see a tags file appear in your project directory:
Now press M-x (ALT x) and type helm-etags-select:
You'll see a fuzzy search window appear:
Now, start typing and see results filter:
Now we just need to map a keyboard shortcut to run helm-etags-select.
This tutorial is based on very helpful guidance from dotneter on Reddit.
Next: How to generate etags for a huge project in Spacemacs on Windows
Leave a comment