7

How do you index code in your projects?

 3 years ago
source link: https://lobste.rs/s/ujr9mg/how_do_you_index_code_your_projects
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
How do you index code in your projects?

Hey all, I’m keen to hear how you index code in your projects and use that index to jump around to where specific symbols are defined (e.g: struct, function, interface/trait), as well as for completion, but that’s a bonus

For the longest time, I’ve been using Vim and to get my cursor to some symbol I use a mixture of

  • Fuzzy find and open a file in the project (FZF :Files or Ctrl+P)
  • Fuzzy find and jump to line in the open buffer (FZF :Lines)
  • Grep the project and jump to line (FZF :Rg)

But when working in Sublime, or other more IDE-like editors (i.e: IntelliJ IDEA) I personally find it more valuable to jump to a specific symbol that has been indexed by the editor. This is the case especially when the project is very large, but even when it’s not.

In the past, for Vim, I’ve used vim-gutentags to run ctags and that has been alright. My main issues are that it can be slow (and cpu intensive) for very large projects, and you have to manage this tags file (though that isn’t the end of the world).

Additionally, from lurking round the web, I get the impression that ctags (and alternatives) aren’t really used anymore or that there’s now a better way of supporting jump-to-symbol in Vim. Is this accurate and, if so, what’s the new alternative?


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK