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.
There should be a solution with the Syntastic plugin, on which you would need to put a PHP static code analyzer like PHPLint.
However I never spent some time to test this !
Other PHP programs can be found on this SO answer.
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.
if !exists("autocommands_loaded")
let autocommands_loaded = 1
"PHP Make
autocmd BufRead *.inc,*.php set makeprg=/usr/local/bin/ZendCodeAnalyzer\ %
autocmd BufRead *.inc,*.php set errorformat=%f(line\ %l):\ %m
endif
map <F7> :silent lmake<cr>:lwindow <cr>:redraw!<cr>
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.
Well, this might not be what you are looking for, but if you must have Vim keybindings (I know I need them), then jVi brings this to NetBeans. I don't know if this is a viable option for you, but maybe this will help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With