2

I know "zfap" command, and it can fold a paragraph.

But how can I fold all paragraph? Is there a magic command can do this job?

I search "global" command, but "global" seems to work only for line mode , How can I do something in all paragraph one by one?

textpattern
  • 397
  • 3
  • 14

1 Answers1

2
:set fde=getline(v:lnum)=~'^\\s*$'&&getline(v:lnum+1)=~'\\S'?'<1':1
:set fdm=expr
kev
  • 155,172
  • 47
  • 273
  • 272
  • 1
    Cf. the third example under the `:help fold-expr` section. – ib. Dec 29 '11 at 13:13
  • Thank you. The fold expression is too diffcult to me, but it works. – textpattern Dec 29 '11 at 13:14
  • @textpattern: I have explained this very fold expression [answering](http://stackoverflow.com/a/5980322/254635) the question "[Explaining foldexpr syntax](http://stackoverflow.com/q/5977895/254635)". – ib. Dec 30 '11 at 00:41