In a post to his site Robert Basic has shared some helpful plugins for PHP developers using Vim as their primary editor. These plugins not only help you jump around in your code but get more context on where you're at.
One thing I was missing for a long time in Vim is to be able to "jump to definition" in an easy and painless way. The other thing I wanted to improve is to be able to tell easily where am I actually in the code base; to see the current class and method name of wherever the cursor was.With a bit of googling and poking around, I finally came up with a perfect combo of 5 plugins (yep, five!) that enables me to do both, and a little bit of extra.
He shows examples of using three different things he wanted to be able to do when working in his code and the plugins that satisfy each:
- Generating and managing tag files for the code (Gutentags)
- Jumping around to definitions (CtrlP)
- Providing context on the current class and method name (tagbar+tagbar-phpctags+lightline and phpctags
One line examples are included showing how to configure them with your current Vim use.