Skip to content

Suggested Setup for Prose

Enno edited this page Jan 19, 2020 · 1 revision

Set up Vim

To complete prose, such as that in text files, by dictionary completion, set

  setlocal dictionary+=spell
  setlocal complete+=k

Set up Mucomplete

Configure mucomplete by

let g:mucomplete#chains = {
                  \ 'default':    ['file', 'keyn', 'omni', 'user', 'defs', 'incl', 'c-n', 'uspl'],
                  \ 'vim':        ['file', 'keyn', 'cmd',  'omni', 'user', 'c-n', 'uspl'],
                  \ 'text':       ['file', 'c-n',  'uspl', 'omni', 'user'],
                  \ }

and likewise for other prose file types, such as mail, gitcommit, markdown or tex in addition to text.

To correct misspelled words on completing by mucomplete, try

let g:mucomplete#can_complete = {}
let g:mucomplete#can_complete.default = {
        \     'c-n' : { t -> t =~# '\v\k{2,}$' },
        \     'uspl': { t -> t =~# '\v\k{3,}$' && &l:spell && !empty(&l:spelllang) },
        \ }

Hints

  • to ensure that common words are suggested first when completing, install complete-common-words.vim
  • to automatically detect spelllang, try vim-DetectSpellLang and hook into the DetectSpellLangUpdate event for further setup.