Follow me as I struggle with rogue technology, insane programmers, and impossible math questions in a battle to the death.

Thursday, January 10, 2008

Vim tags

My favorite text editor is vi, specifically vim in window mode. I can write code and search through a single file much quicker than any other editor due to my memorization of vi's large and powerful command base. The only place vi is weak compared to a heavyweight IDE like Eclipse is when I need to look up the definition of some function I've called that is defined in a different file. The process of opening that file by typing out the entire path can be quite laborious.

Today someone I work with generated tags for the project we're working on that are usable with vi. Though I'd heard about ctags in the past I never had time to sit down and really figure them out. When you combine the ctags Unix command, the taglist plugin for vim, some changes to your vimrc and a small vim script, you can easily get the same functionality as one of those heavy IDEs. Now I can simply put my cursor over the function or variable in question and type a key command to jump to the file and line containing the definition.

Unfortunately, there is a learning curve to set up the tags, whereas Eclipse configures its internal tags for you automatically. However, I have noticed that if you don't originally create your project in Eclipse, the migration can often be a painful experience. Vi gives you the freedom in that it is not an environment that your project exists inside, but an editor which you use to view your project, however you may have set it up.

Labels: , , ,

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home