sponsor Vim development Vim logo Vim Book Ad

Engspchk : Spelling checker: On-the-fly spell checking, multi-language, alternate spellings

 script karma  Rating 524/187, Downloaded by 38614  Comments, bugs, improvements  Vim wiki

created by
Charles Campbell
script type
There are a fair number of ispell/aspell based spelling checkers out there -- but engspchk isn't one of them.  The engspchk source uses Vim's native syntax highlighting to catch spelling errors, so you get quick on-the-fly spellchecking!  An optional external program, agrep, may be used to suggest alternative spellings. With the optional <engspchk.rare> dictionary, <engspchk.vim> now provides over 186730 words (over 189000 when including proper names)!

Engspchk flags rare/unusual words and allows the user to specify his/her preferred dialect (let g:spchkdialect="usa", "uk", or "can").  Click-N-Fix by enabling the mouse (example: :set mouse=n) and a leftmouse click in the document will advance the cursor to the next spelling error; a leftmouse click in the alternative spellings window will substitute the selected word for the misspelled word.  A rightmouse click will do that substitute for all such misspellings in your file.

Engspchk is no longer English-only: it supports multiple languages.  You can tell it what language (dictionary) to use by either renaming it (ex.  engspchk.vim -> frspchk.vim for French) or by specifying the variable g:spchklang (ex. let g:spchklang="ger" for German).  See http://www.drchip.org/astronaut/vim/index.html#vimlinks_scripts for some dictionaries: currently, that includes Dutch, French, Galician, German, Hungarian, Italian, Polish, Russian, Spanish, and Yiddish.

The engspchk s/w includes maps for jumping to the next and preceding spelling errors, alternative spellings, and for saving words either permanently in a custom dictionary or just for the current session.

Engspchk's dictionaries are optional.  SpellChecker, for example, claims to load faster because it doesn't handle unusual words.  Merely deleting <CVIMSYN/engspchk.rare> will speed up loading (which is pretty fast anyway).  Both support flagging dialect-sensitive words, but only Engspchk has Click-N-Fix and rare word support.  Telling the difference between "or the" and "ort he" is easy -- the "ort" will show up with RareWord highlighting (default: black on cyan).

To begin checking your spelling with engspchk, and assuming that <engspchk.vim> has been put into your .vim/plugin directory, simply start up engspchk by applying the English Check map:


and your spelling errors will show up highlighted in white-on-red.  Alternatively, if you're using gvim, select DrChip:Load Spelling Checker from the menu.

If you want to change languages, engspchk provides a lot of ways to help you:

  * set g:spchklang appropriately and \ec will load that language's dictionary.  The backslash is actually using <mapleader>, so you can customize the backslash to whatever you want.
  * you may embed a modeline at the beginning or at the end of the file:  ex. spchk: lang=nl.
  * using gvim, there's a "Load AltLang Spelling Checker" submenu for choosing whatever language(s) for which you have dictionaries!
  * engspchk looks over your dictionaries and constructs simple commands: :Engspchk  :Frspchk  :Gerspchk  :Nlspchk  :Spanspchk  etc,

It will work with some cooperating syntax files to check out spelling in comments, including:

amiga, bib, c, cpp, csh, d, dcl, dtml, elmfilt, exports, fortran, html, java, lex, lisp, mail, maple, sh, sm, smarty, tcsh, tex, vim, and xmath

If your favorite computer language isn't on that list, perhaps you can talk that language's maintainer into making it engspchk compatible.

More Features:

Version 42-45:
  click'n'fix button support improved: with a click, one can re-try alternates, accept misspellings (skip by them), and apply corrected spelling to entire document.  (see :he engspchk-clicknfix)

  The alternative spellings window can now be either on the bottom or on the right hand side. (see :he engspchk-variables)

  PreProc highlighting used to emphasize word selected for alternate spellings

  A number of bug fixes -- see   :help |engspchk-history| (after downloading, of course!)

Version 41:
    Engspchk can be loaded into multiple windows concurrently; one can force spell checking of non-highlighted text with the g:spchknonhl variable; RareWord and Dialect added to the @Spell cluster; and the 'hidden' option is set to allow preserve engspchk highlighting (\ee will restore the user's hidden setting).

Version 40:
    *@Spell cluster utilized.
    *Allow two or more sequential capitalized
     letters to be ignored (English only, acronym support).
    *Yura Kloubakov's inclusion of the user's
     mapleader in the DrChip menu and removal
     of \ec after use
    *Entered dozens of city names into <engspchk.proper>

Version 34:
    The latest engspchk includes:
    differentiating between common, dialect, and rare words, saving/restoring gdefault option maps to make a word a temporary/permanent BadWord

Version 32:
    English dialects supported (usa can uk); bug fixes (ending engspchk, alternatives, etc)

Version 30:
    Engspchk, the native Vim spelling checker, is better than ever!

    * Click'n'Fix:
      - leftmouse to move to the next error
      - leftmouse to select correctly spelled word
      - rightmouse to fix all instances of
        misspelled word
      Makes spell-checking a document Fast and Easy!

    * New maps:
      - \eS, \eT to take a word under the cursor
        out of the user dictionary (permanently
        or just this session)
      - \ee to end engspchk; restores prior maps
        and restores normal highlighting
      - <tab> in alternative-word window does
        a global replace of the misspelled word
        with the user-selected correctly spelled

    * optional auto-jump to next spelling error
      for \es, \et, and \ea.
    * will signal if syntax highlighting is off.
    * Plus a bugfix for Mac users

    Plus engspchk supports a non-English languages,
    checks for spelling inside comments for C, C++,
    Fortran, DCL (VMS), csh/sh/ksh/bash, tex, and

Version 27: New features for the Vim-based spelling checker!

    * Maps to remove words from the user dictionary
      (\eT, \eS).

    * If g:spchk_autonext exists, then \et, \es, and
      \ea (if a word is selected) will automatically
      do a \en jump to the next spelling error.

    * \en and \ep will now examine words inside folds,
      opening the fold as necessary to display spelling

Version 23:
    Can handle English, French, German, Spanish, Dutch,
    Hungarian -- just set up a dictionary and set a
    g:spchklang variable!  Native vim code, no external
    programs necessary

Version 19:
    Now contains: engspchk.vim engspchk.dict
    engspchk.wb engspchk.txt Over 187192 words!
    non-English support menus, documentation, English
    punctuation checking (g:spchkpunc)

Alternative Spelling Checkers
    SpellChecker - Ajit Thakkar                   - syntax     - vimscript#499
    vimspell          - Mathieu Clabaut            - [ia]spell   - vimscript#465
    spellcheck      - Matthias Veit                 - ispell       - vimscript#131
    spell                - Yegappan Lakshmanan - spell        - vimscript#232
    vim-spell         - Luc Hermite                    - [ia]spell  - vimscript#135

Thank you for ranking engspchk!

(alpha/beta version available at http://mysite.verizon.net/astronaut/vim/index.html#ENGSPCHK)
install details
1) put engspchk.tar.gz into your .vim directory
2) gunzip engspchk.tar.gz
3) tar -xvf engspchk.tar
4) vim
   :helptags ..wherever../.vim/doc
   :help engspchk-start  <-- startup directions for Unix/Linux/Cygwin
   :help engspchk-win32  <-- startup directions for Windows

From there the directions explain how to set up CVIMSYN, an environment
variable; how to set up Click-N-Fix; how to enable plugins; how to
choose a bottom-of-screen or right-side alternative-spellings window;
and how to choose your preferred dialect.  Your choice!

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
engspchk.tar.gz 64 2006-10-30 6.0 Charles Campbell When filetype is mail, spell checking no longer takes place in initial lines
engspchk.tar.gz 63 2006-02-15 6.0 Charles Campbell Small things: includes CVIMSYN/engspchk.match, uses cecutil, and CVIMSYN can now have spaces in its path
engspchk.tar.gz 62 2005-07-12 6.0 Charles Campbell cpo workaround and improved visual-block only spellchecking
engspchk.tar.gz 61 2005-03-14 6.0 Charles Campbell A check is made for +clipboard before attempting to clear it
engspchk.tar.gz 60 2005-02-11 6.0 Charles Campbell Engspchk now has improved operation with html.
Engspchk checks if "m" is part of guioptions before doing (un)menu operations.
Contractions have now been moved to [lang]spchk.contraction; hopefully, some
folks will step up and make some contraction dictionaries for their native
languages (I know that French, for example, needs such support!).
engspchk.tar.gz 59 2004-12-15 6.0 Charles Campbell Silenced all "unmenu" operations; included more tests to see if the gui is actually running before attempting to (un)install menus
engspchk.tar.gz 58 2004-11-09 6.0 Charles Campbell Engspchk now has language-specific starting commands: :Engspchk :Nlspchk :Spanspchk etc (which are based on the dictionaries you have available in $CVIMSYN)
Error messages now have a "press <cr> to continue" message so that one can see them.
Bugfixes: modeline priority, modeline highlighting, incomplete saving/restoration of user maps
engspchk.tar.bz2 57 2004-06-17 6.0 Charles Campbell New Feature: \ev enables spell checking on just a visual-block (ie. ctrl-v, v, or V), and \eV removes the block restriction
New utf8 German (with two dialects) and Russian dictionaries (tnx, Sergey Markelov!)
bugfix: when mapleader wasn't explicitly set, a variable-not-found message resulted.  Fixed (tnx, Sergey Markelov!)
engspchk.tar.bz2 56 2004-06-14 6.0 Charles Campbell \ej, \eJ: enables saving words to and from *spchk.proj, engspchk's project support.
bugfix: the loading of colorschemes usually wiped out RareWord and Dialect highlighting.  A CursorHold is now used to restore such highlighting.
bugfix: usually languages (C Vim Mail etc) want to confine spellchecking to certain regions (ie. comments).  The latest engspchk does that, but the dictionaries needed to be changed.  engspchk.dict is changed for you, but new non-English dictionaries also need to be obtained.
engspchk-v55.tar.bz2 55 2004-06-07 6.0 Charles Campbell Bugfixes: now uses finish instead of exit for certain errors, an exception has been made for mail for extensive spell checking, the "-" has been removed from iskeyword for French (please let me know if other languages need it removed, too!), an improved search method for dictionaries (often won't need CVIMSYN set anymore!).  Most important, a bug with wordlist generation caused some words to be dropped that should not have been.  Pls wipe out your old engspchk.wordlist and let engspchk v55 re-generate it!

engspchk-v50.tar.bz2 50 2004-05-11 6.0 Charles Campbell \er and \ed now cycle through three states:
  "RareWord/Dialect : Error : no" highlighting

Engspchk now supports modelines (spchk: ...)
where one may set options such as acronym,
altright, autonext, cvimsyn, dialect, DrChipTopLvlMenu,
mouse, nonhl, proj, punc, silent, and lang.

Engspchk has dictionaries for: Dutch, Galician, German,
Hungarian, Italian, Russian, Spanish, Polish.  A Yiddish
variant has also been made available.  See
Engspchk supports selecting from multiple languages by mouse.
engspchk.tar.gz 2.09 2002-01-30 5.7 Charles Campbell Initial upload
ip used for rating:

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.