2

While writing plain text (not code), I'd like a completion based on more context, an exmple would speak more so here it is:

Given the following buffer (a preloaded big text corpus would make more sense in reality):

foo bar baz
foo bar baz
foo bar boo
poo bar bot

and then typing:

foo bar

(followed by a space and M-/) I'd like dabbrev (or something else) to propose, in the following order:

  • baz, because it appears twice after foo bar, so it's the more probable one.
  • boo, because it appears after foo bar
  • bot, because it appears after bar

Currently dabbrev would propose bot first, as the nearest possible word following bar, if I understand correctly.

In other words, I'd like completion based on Markov chains. Does it already exists? Would it be hard to implement?

Drew
  • 75,699
  • 9
  • 109
  • 225
  • I'm able to do something by using `lsp-mode`, and a backend in Python using `pygls` (https://github.com/JulienPalard/po-language-server), but not with dabbrev. – Julien Palard Apr 26 '21 at 21:23

0 Answers0