vimtricks.wiki Concise Vim tricks, one at a time.

How do I include spell-checked words as completion candidates in Vim insert mode?

Answer

set complete+=kspell

Explanation

Adding kspell to the complete option makes <C-n> and <C-p> draw from the active spell word list — every word Vim considers correctly spelled. When you are writing prose in Markdown, reStructuredText, or plain text files, this turns Vim's built-in spell checker into a lightweight autocomplete dictionary, without any plugin required.

How it works

The complete option is a comma-separated list of sources for insert-mode completion (<C-n> / <C-p>):

  • . — current buffer (default)
  • b — all loaded buffers (default)
  • t — tag files (default)
  • kspell — words from the active spell word list

kspell only contributes candidates when spell is actually on (:set spell). You can combine both settings in one line:

set spell spelllang=en_us complete+=kspell

Example

With spell mode and kspell enabled, typing inter<C-n> in a Markdown file might offer completions like interface, interpret, interrupt, internal — all valid dictionary words, not just words already in the current buffer.

Tips

  • Scope this to prose filetypes only so it does not pollute completion in code files:
    autocmd FileType markdown,text,rst setlocal spell complete+=kspell
    
  • The spell language controls which words appear: set spelllang=en_gb for British English, set spelllang=en_us,de for multilingual editing
  • Use zg to add the current word to your personal wordlist and zuw to undo that addition
  • For pure keyboard-driven writing, pair with <C-x>s (spell-specific completion) which only suggests correctly-spelled alternatives for the word under the cursor

Next

How do I highlight all occurrences of a yanked word without typing a search pattern?