6

When i press ) in Vim it jumps to the next sentence. In evil, however, ) (evil-forward-sentence) at the beginning of the following paragraph takes you to the paragraph's end, while in Vim it jumps to "Donec a diam":

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit. Donec et mollis dolor.

Is this a bug or a config error on my side?

Dan
  • 32,980
  • 7
  • 102
  • 169
Jason Mirk
  • 723
  • 4
  • 16

1 Answers1

7

The problem is a configuration "error": the paragraph you pasted has sentences separated by a single space, and your setup is probably expecting sentences to be separated by two spaces.

The simplest solution is to (setq sentence-end-double-space nil). As the manual on "Sentences" notes, though, doing so is not without drawbacks:

If you want to use just one space between sentences, you can set the variable sentence-end-double-space to nil to make the sentence commands stop for single spaces. However, this has a drawback: there is no way to distinguish between periods that end sentences and those that indicate abbreviations. For convenient and reliable editing, we therefore recommend you follow the two-space convention.

Dan
  • 32,980
  • 7
  • 102
  • 169
  • This is weird. Who writes with two spaces between sentences? Even the manual on sentences doesn't do that. Oh emacs... – Jason Mirk Jul 30 '15 at 15:08
  • 3
    Actually, I do, for one. Way back in the day, that's how we were taught in typing class, and there's a long debate about whether you should or should not use the two-space convention (cf. wikipedia article on sentence spacing). I find it especially helpful when using monospaced fonts, as it helps me see sentence beginnings/endings more easily. – Dan Jul 30 '15 at 15:11
  • That's interesting. – Jason Mirk Jul 30 '15 at 15:13
  • @JasonMirk I think it would also be safe to say that most young people do not double space their sentences, and that the practice is gradually dying out due to well-tuned fonts. – PythonNut Jul 30 '15 at 16:18
  • I remember reading in a computational linguistics book that [\.!\?] space capital-letter is actually a pretty good heuristic for sentence divisions in English text. Is there a way to use an arbitrary function for dividing sentences? – Greg Nisbet Sep 18 '15 at 15:22
  • @GregoryNisbet - That heuristic fails for, say, "Mr. Nisbet". – Christian Conkle Oct 05 '15 at 17:19
  • @ChristianConkle - I did not remember the source very well: "The simplest and perhaps most popular algorithm for sentence boundary disambiguation is known as 'period-space-capital letter' ... However the performance of this algorithm is not very good. It produces an error rate of about 6.5 per cent measured on the Brown corpus and the WSJ. For better performance the ... algorithm can be augmented with a list of abbreviations and a lexicon ... and was measured to produce about 3-3.5 per cent error rate". Still, 94% precision and nearly 100% recall is okay for quickly navigating text right? – Greg Nisbet Oct 10 '15 at 15:57