Your browser does not support JavaScript!
Upvotes Anonymous 2 User 0

How to setup etags for fuzzy symbol searching in Spacemacs on Windows

What do etags do?
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.
Install etags
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).
Edit your .spacemacs
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.
Create a Project
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.
Generate Tags
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:
Fuzzy-searching for tags
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
Credits
Was this helpful?

Tags

Comments

Leave a Comment

I agree to the Terms of Service
Design © 2015, Downranked, LLC.,
Original user code contributions under MIT License