On Thu, 5 Aug 2010, Dimitar DIMITROV wrote:
> Hi,
>
> When using
>
> :vglobal/\S/,/\S/-j|noh (this reduces several empty lines following one
> another to just one line)
>
> on a php file:
>
> <?php
>
> class Test {
>
> public function init()
> {
> echo '1';
>
> echo '2';
> echo '3';
> echo '4';
> echo '5';
> }
> }
>
> with
>
> :set foldmethod=syntax
>
> and everything folded (zM)
>
> the code is scrambled:
>
> <?php
>
> class Test {
>
> public function init()
> {
> echo '1';
> echo '2'; echo '3'; echo '4'; echo '5'; }
> }
>
> I imagine this is a PHP syntax script problem
Doesn't have anything to do with PHP.
Using this file:
==== test.txt ====
leading
a
b
c
d
following
==================
With fdm=manual, create a manual fold over the 'a' line through the 'd'
line (using 'zf'). Same 'problem'. But, I'm not sure what that problem
is, since I'm not sure how your :vglobal command works.
Roughly, from what I can tell:
:vglobal/\S/ -- for all lines without non-whitespace (i.e. forall blank lines):
, -- repeat last f F t T search (or does ',' do something different
here?)
/\S/ -- find next non-whitespace line
-j -- join with prior line
( |noh -- then disable hlsearch)
--
Best,
Ben
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php