I use Taglist in VIM, but one particular PHP application which I have inherited is coded with if()'s and elseif()'s and include()'s extensively. Not a single method or function in almost 5000 lines of code per file (and tens or hundreds of files). Is there any way to use Taglist or another plugin to get an overview of the code flow? I'm thinking of something along the lines of showing the conditions in the if()'s in a concise manner in the sidebar, including their hierarchy. Anything remotely close to that would be great.
Thanks!
this involves a little bit work, you'll need to compile a modified version of exuberant ctags with modified rules for php.
you might want to have a look over here: http://ctags.sourceforge.net/EXTENDING.html
Using foldlist plugin along with foldmethod-syntax
(or tweaking your own foldmethod-expr
) would work nicely.
In fact, even without the plugin I believe a proper fold setting would work miracles. Some recommendations:
set foldmethod=syntax
or (set foldmethod=expr
and set foldexpr=...
for your case)set foldclose=all
to hide all those nasty ifsset foldcolumn=2
or greater to see the nesting levelset foldtext=MyFoldText()
and make a function to show you relevant information, like:
function! MyFoldText()
let line = getline(v:foldstart)
let line = substitute(line, 'if(\(.*\)).*', 'if: \1', 'g')
" ... etc
return line
endfunction
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