sponsor Vim development Vim logo Vim Book Ad

vimspell : ispell or aspell based spell checker with fly-spelling

 script karma  Rating 1948/723, Downloaded by 35892  Comments, bugs, improvements  Vim wiki

created by
Mathieu Clabaut
script type
***** note to VIM 7 users ! *****
Version 7 of vim integrates a native spellchecker which outperforms  vimspell script.
As such I will not maintain anymore vimspell script, and you are advised to delete all
related files from your plugin/ and doc/ directory, and use the native spellchecker instead.

This script is based on Claudio Fleiner's spell checker and uses ispell (or aspell)
to highlight spelling errors, and provides mappings (including a popup menu opened
by right clicking on a mispelled word) to correct them, with suggestions.

It is possible to set up the script to do automatic spellchecking (ā la
word --- the current visible window is checked, and errors are highlighted on the fly).
For that, just redefine the spell_auto_type variable (let spell_auto_type="tex,doc,mail") in such a maner
that all the filetypes for which you want on the fly spell check are listed ("none", and "all" token are treated).
Much more documentation on all options can be found at the beginning of the script, or
after having install it, by typing the command ":help vimspell".

Feedback (suggestions, bug report, questions,...) is welcome ....

You can subscribe to a mailing list to receive annoucement for new versions by sending a mail
here at vimspell.announce-request@ml.free.fr  with subscribe in the subject.
install details
Copy vimspell.vim into your ~/.vim/plugin directory
The help file shall be automagically installed when launching VIM.

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
vimspell.vim 1.100 2005-09-14 6.0 Mathieu Clabaut - UTF-8 bug workaroud (hack from Huidae Cho),
- Ability to type 01 to 09 to select one of the first 9 alternatives (patch
  from M.Sureshkumar),
- Suppression of some debugging output,
- Some corrections to better work under windows and notably, addition of   default shell handlling for windows thanks to Wojciech Pietron.
- Silent some warnings.
vimspell.vim 1.95 2005-01-04 6.0 Mathieu Clabaut - Correcting spell errors when typechecking lines with ` inside.
- Apply patch from Olaf Conradi to manage the cases when mapping already
  exists for <Space>, '.' and so one in insert mode.
- Correction to use the new aspell command line interface
- workaround inoremap preventing abbreviations expensions in vim 6.3 (however,
  there are still some unwanted behaviour).
- Better language recognition for mail filetypes.
- Include some longstanding patches from Alex Efros. (Use of \k instead of \w
  in regexp, and better usage of language specific iskeyword.)
- Take csh into account. Addition of 'spell_shell' variable and associated
- Correction of line quoting bug which appeared in tex/latex file (bug
  reported by Yann  Golanski).
- Add Hugo Hass patch : spell_guess_max_lines
- Addition of filetype "text" and "" to spell_markup_ft option.
- Add some FAQ documentation, improve the documentation about spell_markup_ft
vimspell.vim 1.84 2004-04-22 6.0 Mathieu Clabaut Add mail to the default content of 'spell_markup_ft' variable (errors where not highlighted anymore during mail composition).
vimspell.vim 1.83 2004-04-21 6.0 Mathieu Clabaut Bug correction - highlighting inside cluster was badly set, depending on when SpellSetupBuffer was called
Addition fo auto jump option (jump to next error after correction).
Correction of a bug where cursor was jumping when on the last line of a file.
Correction of html file highlightings.
Correction of spell_guess_language_ft usage (wasn't taken into account).
Performance issue : check of @Spell cluster existence in syntax highlightings was removed, and replaced by heuristic and manula configuration. see spell_markup_ft variable.

Many thanks to  Paul Jolly, Tomas Hoger, Michaeljohn Clement, Hugo Haas and Markus Braun.
vimspell.vim 1.78 2004-04-20 6.0 Mathieu Clabaut - Add a language auto-detection function.
- Corrects a bug which causes delays during buffer switching (function SpellTuneCommentSyntax).
- Correction for bug wich prevents use of alternatives number 10 and 20
- Use of alternatives usable even when spellchecking is not automatically done
- Samm optimization to improve buffer switching latency.
vimspell.vim 1.73 2004-04-19 6.0 Mathieu Clabaut - at most 20 alternatives are now proposed (was 10)
- 'r'eplace choice was remove (was broken, and of no much use).
vimspell.vim 1.72 2004-04-19 6.0 Mathieu Clabaut - Correction of a performance issue (syntax match was continuously append, which slow down vim after some times).
- Correction of a bug, which cause unwanted behavior when the user hit another key than those proposed to correct spell errors.
vimspell.vim 1.70 2003-11-19 6.0 Mathieu Clabaut - Spell checking in insert mode does not break undo stack anymore, thanks to
  Hari Krishna Dara.
- Jumping to next error now works, even if some text is not spellchecked
  (like comments).
- Bug with /si and aspell corrected
- Use @Spell cluster to spell specific region according to the highlighting
  definitions (Idea from vim@vim.org discussion and from engspchk.vim. Thanks
  to Mr.Campbell)
- Suppress menu bug, when changing language by calling directly
- Some minor documentation improvement.
vimspell.vim 1.68 2003-09-08 6.0 Mathieu Clabaut - Remove "silent" keyword which (for some unknown reason) prevent mapping to
  replaceword (1,2,..) to be removed,
- Bug workaround to prevent coma to be added to 'iskeyword' option (thanks to
  Mark Waggoner)
- Bug correction when line contained \,
- Bad filetype recognition bug correction,
- SpellCheckLine correction. Spell checked was not done after each word,
- aunmenu warning correction...
- more menus,
- more bugs to be corrected :(
vimspell.vim 1.67 2003-08-04 6.0 Mathieu Clabaut previous upload failed...
vimspell.vim 1.67 2003-08-03 6.0 Mathieu Clabaut New function: popup menu with <RightMouse> to select alternative.
Make spell_filter option working.
Ensure usage of /bin/sh instead of [t]csh variants (problem with double
Include Sandra schrödter patch for SpellCaseAccept problem.
Add a map to '.' as a hook to spell check current line in insert mode.
Documentation update.
Cleaning of help autoinstallation functions (Guo Peng Wen).
vimspell.vim 1.64 2003-07-28 6.0 Mathieu Clabaut - Include patch of Philippe Sum to make vimspell work with windows (untested).
- Disable hlsearch when doing <leader>sp and <leader>sn.
- Save and restore backspace option when spell_insert_mode is set.
- Do not check current window if spell_auto_enable is not set or set to 0.
- In insert mode, do not check current line when no new words were inserted (fastest operation when typing several spaces).
- Correct bug where error highlighting vanished when reentering a buffer already checked (as a result, less computation are done when switching).
Add Markus Braun patch to remove SpellProposeAlternatives mapping when hitting ESC key.
vimspell.vim 1.61 2003-07-21 6.0 Mathieu Clabaut Include Guopeng Wen to
- fix error in SpellCheckLanguage when there is no menu.
- fix SpellSetupBuffer behaviuor when autocommand are enables.
vimspell.vim 1.60 2003-07-21 6.0 Mathieu Clabaut Some escaping bug corrections.
Documentation updated.
Escape Space in filename.
Cursor position restoring in SpellCheckWindow.
Iskeyword is now set globally.
LoadIsKeyword function is suppress. SpellSaveIskeyword is only call when setting up buffer.
Inclusion of Guopeng Wen  patch to minimize overhead
of vimspell use when no menu are used and when no autospell is done.
Add faq about minimizing vimspell overhead.
Inclusion of Markus Braun patch:
- s:SpellSetupBuffer() call s:SpellSetSpellchecker() only when it was not called before
- Right calculation of the window top and bottom position, even if fold are  present (idea from Mark Hillebrand, who used this in his FirstWinLine() and  LastWinLine())
Verify that mapleader is defined before being used.
Add language and filetype dependant 'iskeyword' options...
Minor menu enhancment.
Bug ands todolist update.
vimspell.vim 1.49 2003-05-06 6.0 Mathieu Clabaut Bug correction: SpellCheckLine didn't work when the line contained quotes.
vimspell.vim 1.48 2003-05-05 6.0 Mathieu Clabaut   - Experimental on the fly spell checking in insert mode. Thanks to Mikolaj Machowski
   (new options spell_insert_mode).
  - Addition of "none" and "all" token for the spell_auto_type
  - FAQ section in documentation.
  - Beginning of a solution for auto help installation bug (the help
    file was not installed when vimspell was not in a user writeable
    directory. Thanks to Peter Kaagman
  - Some documentation addition and correction.
  - Some code cleaning and ordering.
vimspell.vim 1.46 2003-03-17 6.0 Mathieu Clabaut Apply patches from Markus Braun (many thanks to him):
- removed the need of sed, sort, awk external tools
- removed the spell_fly_error variables
- fixed small bug when proposing alternatives.
Fix small bug when manually calling SpellSetLanguage. Kindly reported by JF L.
Remove highlighting when changing language or spell checker.
Minor cosmetic changes.
Add Markus Braun Patch which display spell check stats.
Do not load vimspell when 'compatible' is set.
Small bug when unletting undefined variable.
Language menu initialization is now correct.
Update TODO list.
vimspell.vim 1.40 2003-03-06 6.0 Mathieu Clabaut New feature : auto-installation of vimspell help file
Documentation correction and polishing (it now follows the help format).
Add <Leader>sA map for SpellAutoDisable
Rework of vimspell option documentation.
Correct Spellexit function.
<Leader>sq now call SpellAutoDisable instead of SpellExit.
SpellChecker is call in auto mode when window loose focus.
vimspell.vim 1.33 2003-01-06 6.0 Mathieu Clabaut Add preliminary support of spell errors highlighting in comments.
Correct nasty bug, which causes lost of data when auto spell check was
selected and the number of lines of the text was less than the window height.
Correct bug when serching for next or previous errors.
Cursor position is now restored after a spell check.
Thanks to Markus Braun <Markus.Braun@krawel.de> and Igor Goldenberg
vimspell.vim 1.30 2002-12-16 6.0 Mathieu Clabaut Add parameters to tune vimspell menu position.
Correct bug, which prevents user defined spell_language_list to be used.
Correct a bug, which reactivate auto-spell when entering a buffer, even if it
was previously disable.
vimspell.vim 1.28 2002-12-11 6.0 Mathieu Clabaut Small patch to 'spell_auto_type' usage (all buffer with no filetype were spell
checked by default).
Add credits.
vimspell.vim 1.26 2002-12-11 6.0 Mathieu Clabaut Correct spell_auto_type behaviour. There was a bug which made AutoSpell enable for all file types.
vimspell.vim 1.25 2002-12-11 6.0 Mathieu Clabaut Correct bug with aspell (add word to local dictionary didn't work), kindly reported by Andrew McCarthy <andrewmc-vim@celt.dias.ie> and Alberto Ornaghi <alor@sikurezza.org>
vimspell.vim 1.23 2002-12-10 6.0 Mathieu Clabaut Add (requested) documentation about setting up on-the-fly spell check,
add spell_auto_type and spell_no_readonly variables to tune when on-the-fly
spell checking is done.
Still on bug about highlighting (see TODO list in documentation section), if someone wants to tackle it....
vimspell.vim 1.22 2002-12-09 6.0 Mathieu Clabaut Bug correction : Spellcheck on the fly for the visible window now preserve
informations from previous global spellcheck (<Leader>ss).
Dictionnaries are rescan whenever the spellchecker is changed.
vimspell.vim 1.20 2002-12-02 6.0 Mathieu Clabaut Documentation and minor modifications.
Add  filetype and spell checker dependant options (support by default tex,html,sgml, and nroff or email modes).
English corrections.
Make several variables bufferwise (language, spell_executable,...)
Add functions and menu to change spellchecker
Correct bugs.
Add a better dictionaries detection for aspell.
vimspell.vim 1.17 2002-11-27 6.0 Mathieu Clabaut Correct a bug when applying suggestion on a word at the beginning of the buffer.
Thanks to Markus Braun.
vimspell.vim 1.16 2002-11-27 6.0 Mathieu Clabaut Add credits,
Use update instead of write,
Replace <ESC> default mapping by <Leader>
Correct nasty bug (SpellIgnore)
Improve menus.
Improve dictionnaries auto-detection.
vimspell.vim 1.14 2002-11-25 6.0 Mathieu Clabaut Much more parametrization (see documentation at the beginning of the script).
Use aspell or ispell.
Use as many language as available. Auto detect availables dictionnaries.
More functionnal menu.
Bug correction.
vimspell.vim 1.13 2002-11-07 6.0 Mathieu Clabaut Comments and a bit of documentation.
Some cleaning.

need some more parametrization and cleaning.
vimspell.vim 1.12 2002-10-30 6.0 Mathieu Clabaut 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.