StanAngeloff / php.vim

An up-to-date Vim syntax for PHP (7.x supported)
477 stars 69 forks source link

Add support for folding phpDoc comments #33

Closed sudar closed 10 years ago

sudar commented 10 years ago

Introduced a new option php_phpdoc_folding which can be set to 1 if folding of phpDoc comments is needed.

It is set to 0, so that phpDoc comments folding is not enabled by default.

Fix #32

StanAngeloff commented 10 years ago

I very much like the approach :+1: One tiny comment about delcommand which is good practise.

sudar commented 10 years ago

Added the delcommand and amended the commit.

sudar commented 10 years ago

Thanks.

StanAngeloff commented 10 years ago

Ah, wish there was control over how the comments get folded. It's very unhelpful to see them collapsed, but not at least the first line of content. php-foldexpr already does a pretty good job at improving on this.

I have wondered if having folding in the main syntax file is worth it, a separate bundle seems like a far better option.

swekaj commented 10 years ago

I could even add an option to the foldexpr.vim script to make that optional and just use the foldtext.vim script to fold based on syntax but have better fold text displayed.

@sudar if that sounds appealing to you, make an issue on php-foldexpr and I'll look into tonight (PDT timezone).

sudar commented 10 years ago

I have wondered if having folding in the main syntax file is worth it, a separate bundle seems like a far better option.

Yes, even I feel the same. You can remove all fold related code and then add a note about php-foldexpr in the readme.

Personally at least I am very impressed by php-foldexpr and I am going to turn of folding in the PHP syntax file and use it for folding.