1 Tests for folding. vim: set ft=vim :
5 :" We also need the +syntax feature here.
11 :" basic test if a fold can be created, opened, moving to the end and closed
13 zf2j:call append("$", "manual " . getline(foldclosed(".")))
14 zo:call append("$", foldclosed("."))
15 ]z:call append("$", getline("."))
16 zc:call append("$", getline(foldclosed(".")))
17 :" test folding with markers.
18 :set fdm=marker fdl=1 fdc=3
20 :call append("$", "marker " . foldlevel("."))
21 [z:call append("$", foldlevel("."))
22 jo{{
\er{jj:call append("$", foldlevel("."))
23 kYpj:call append("$", foldlevel("."))
24 :" test folding with indent
27 i
\ejI
\e:call append("$", "indent " . foldlevel("."))
28 k:call append("$", foldlevel("."))
29 :" test syntax folding
31 :syn region Hup start="dd" end="hh" fold
32 Gzk:call append("$", "folding " . getline("."))
33 k:call append("$", getline("."))
34 :" test expression folding
36 let l = getline(v:lnum)
48 :set fdm=expr fde=Flvl()
50 :call append("$", "expr " . foldlevel("."))
52 :call append("$", foldlevel("."))
54 :call append("$", foldlevel("."))
56 :call append("$", foldlevel("."))
57 :/^last/+1,$w! test.out