Re: Code folding without explicit end matches

2011-04-19 Thread Ben Schmidt
It is 2 lines, and the ^M is indeed a ctrl-M, that can be typed as you did, or by ctrl-q. Depending on your vim options you may also be able to use or \n to get the same effect. \r not \n, especially in this case (the replacement in a :s command). Using \n would put a null byte in your file, no

Code folding without explicit end matches

2011-04-18 Thread howard Schwartz
IOW the last line in the file will never get folded with this range. I'm not sure how to correct it. quite easy to fix that: never mind my use of %$ in the or statement, just use a substitute command to add a line with, Topic: to the end of the file. Fixed! alternately, any any blank or nonse

Re: Code folding without explicit end matches

2011-04-18 Thread Tony Mechelynck
On 19/04/11 03:34, Leslie Viljoen wrote: g/^Topic: */,/^Topic: *\|\%$/-1fold If you put these two commands in a script, they will be executed, when you source the script, so you need not prepend a colon or hit return for each command. Again, you may be interested only in the second c

Re: Code folding without explicit end matches

2011-04-18 Thread Tony Mechelynck
On 19/04/11 03:04, howard Schwartz wrote: Leslie wrote: I don't know what to make of this. For one thing I can't type it without "trailing characters" errors. Is it all one line? Is it an ex command? I tried inserting the ^M's with ctrl-q-ctrl-m but it immediately terminated the command. It i

Re: Code folding without explicit end matches

2011-04-18 Thread Leslie Viljoen
>          g/^Topic: */,/^Topic: *\|\%$/-1fold > > If you put these two commands in a script, they will be executed, when you > source the script, so you need not prepend a colon or hit return for each > command. Again, you may be interested only in the second command. > > Clear I hope? Yes, than

Re: Code folding without explicit end matches

2011-04-18 Thread howard Schwartz
Leslie wrote: I don't know what to make of this. For one thing I can't type it without "trailing characters" errors. Is it all one line? Is it an ex command? I tried inserting the ^M's with ctrl-q-ctrl-m but it immediately terminated the command. It is 2 lines, and the ^M is indeed a ctrl-M, t

Re: Code folding without explicit end matches

2011-04-18 Thread Leslie Viljoen
On Apr 18, 1:18 pm, Ben Fritz wrote: > Leslie Viljoen wrote: > > I think the problem would be solved if Vim could recognise a new > > section starting and use that to terminate the previous one. Looking > > at Python syntax files, it looks like people are using huge vimscripts > > to solve a sim

Re: Code folding without explicit end matches

2011-04-18 Thread Leslie Viljoen
On Apr 17, 6:44 pm, howard Schwartz wrote: > Im not sure if this idea might help, but I faced a similar problem in folding > blocks of text within email digests like that for vim_use. And I did not have > the stomach for fancy, script-based folding strategies. So I discovered > something simple.

Re: Code folding without explicit end matches

2011-04-17 Thread Ben Fritz
Leslie Viljoen wrote: > I think the problem would be solved if Vim could recognise a new > section starting and use that to terminate the previous one. Looking > at Python syntax files, it looks like people are using huge vimscripts > to solve a similar problem - which is a bit of a hack I think

Code folding without explicit end matches

2011-04-16 Thread howard Schwartz
Im not sure if this idea might help, but I faced a similar problem in folding blocks of text within email digests like that for vim_use. And I did not have the stomach for fancy, script-based folding strategies. So I discovered something simple. Here is a fold for blocks of text that appear with

Code folding without explicit end matches

2011-04-16 Thread Leslie Viljoen
Hi everyone I have been trying to create a syntax file for Inform7 that will include code folding. Unfortunately Vim does not seem to like the fact that Inform7 does not have explicit endings to regions - a section is ended by a new section starting. Inform7 has sections like this: Section 1 He