Tag search

Patching exuberant-ctags for better PHP5 support in vim

by Sander Marechal

Thanks to the taglist vim plugin, vim users have access to a decent tag browser. A tag browser allows you to view a list of all variables, functions and classes and quickly jump to their definitions. Taglist is built on exuberant ctags so it support a large amount of languages. Unfortunately however, when the exuberant ctags people replaced their old PHP lexer with a brand new regexp-based parser the quality of parsing PHP code decreased dramatically. Ctags suddenly could not distinguish real class and function declarations from mere mentions of the words “class” and “function” in multi-line comments. This is because the ctags regular expression parses is inherently line oriented.

In this article I have two patches that greatly improve PHP support in exuberant-ctags. I will also show you how you can apply these patches on a Debian-based system.

Update 2009-07-07: David Mudrak has written an updated patch for Gentoo. I have ported his improvements back to my patch here. It fixed a problem with old-style functions without a visibility declaration and it applied the same trick to interfaces as well.

My list of must-have vim scripts

by Sander Marechal

I love (g)vim! I've been using a lot of different text and code editors over the years. When I started with Linux my first editor was Anjuta. After that I've tried BlueFish, Screem, SciTe, (X)Emacs, Gedit and many more until I stuck with Kate. But in the end, every Linux programmer eventually drops whatever editor or IDE that he or she uses and switch to either Vim or Emacs. I switched to Vim.

Vim is great all by itself, but there are a ton of scripts that you can use to expand vim make your life easier. Here are the vim scripts and settings that I use every day.

Digg this article: This article on Digg