Lately I’ve been making a couple of mistakes when refactoring in Vim, the result was undefined and unused variables. Any decent IDE (like NetBeans) would mark them as such, but I’ve yet to come across a Vim plugin that does the same.
Can anyone help me out? I’m mainly programming in PHP.
You can run Zend’s PHP code analyzer from within VIM. I currently do this. The catch is that Zend Code Analyzer is no longer packaged as a separate binary when installing Zend Studio. I’m not sure which OS you are running. I’m running on OS X. If you don’t already have the binary, use steps 1 & 2 on this site to get it – http://michalf.me/blog:zend-code-analyzer-in-textmate. You may have to adjust for your OS.
After getting the binary add the following to your .vimrc and replace the /usr/local/… with the path to your ZendCodeAnalyzer.
Now when you enter F7 it will run make which is set to run the ZendCodeAnalyzer. It will put the results into a location list – :help location. You can scroll through the location list and hit enter on a line and it will take you to that line in your file. If it doesn’t find anything, then it won’t open anything.