RE: (idea for a patch) Sentences, paragraphs
Just thinking about sentences and paragraphs...
>> 2 -- The definition of a sentence is suitable for plain text but notHmm, okay, how about this html:
>> very useful for html
>That doesn't look like a sentence to me. I would call it a line or a
This is a sentence. <i>This is one in italics.</i> This is a third
<li>Here's a sentence. Here's another one.</li>
Some sentences here will not be recognized as such because there's no
space after the '.' -- but in HTML a '.' is often followed by a tag, not
by spaces. Perhaps the rule could be (in regex form) \w\.\W
That would also recognize 'Exclamations!?' and 'Ellipses...', which I
tend to think would be a good thing.
>> A -- expand the range of characters that can end a sentence toinclude
>> Japanese (and other) punctuation.Allow the user to specify a list of such characters in an option? Or
>A generic solution would be useful.
just hardcode the set of characters that Unicode considers to be
sentence delimiters? I think I'd favor the latter because having
useful, fast hard-coded behavior is a strong point of vim. Then allow a
regex if the user needs the definition of 'sentence' to be really
>> C -- have two options, for paragraph and section, each containing aThe user would usually want something like /^\t\w* or /^\s*$, which
>Useful, but can be a bit slow. Would have to check every character
>position if the regexp matches.
should be fairly fast. If they give a difficult regex that doesn't
start with '^', that's their choice.
>> D -- just maybe have an option for sentence searches.I wasn't aware of \zs when I wrote that. There's always one more
>Sounds like almost the same thing as (C). You can use "\zs" to set the
feature in vim. I guess \zs would allow you to exactly duplicate the
current behaviour, even when the sentence ends the line.
>> E -- just maybe, depending on feasibility, have syntax highlightingadd
>> sections in the same way it adds folds now. This is just an idleYes, that would be the right way to do it...
>> thought, I doubt I could implement it.
>A more generic way would be to use a regexp to find a section and allow
>using syntax elements in the regexp. This can be very slow though.