SpellCheck : Work with spelling errors.
| script karma |
Rating 7/4,
Downloaded by 328
|
Comments, bugs, improvements
|
Vim wiki
|
| created by |
| Ingo Karkat |
| |
| script type |
| utility |
| |
| description |
DESCRIPTION
Vim offers built-in spell checking; when you enable it via 'spell' and
'spelllang', you can jump to the highlighted spelling errors in the buffer via
]s. With spelling errors scattered across a large document, Vim does not
provide an overview or report about the overall spell situation.
This plugin populates the quickfix-list with all spelling errors found in a
buffer to give you that overview. You can use the built-in quickfix features
to navigate to the first occurrence of a particular spell error. You can also
manage the spelling errors (mark as good / bad word, globally replace with
suggestion) directly from the quickfix window via the usual zg, zw, z=
etc. mappings.
A typical workflow (e.g. when composing email, commit messages, or any form of
documentation) includes writing and/or quitting the buffer, unless some
remaining spelling errors require further intervention. This plugin offers
auxiliary enhanced variants of :bdelete, :write and :quit that check for
spelling errors and only execute the action if none were found. So by using
these replacement commands, you'll never send or commit messages full of
embarrassing typos any more!
USAGE
:[range]SpellCheck[!] Show all spelling errors as a quickfix list.
For multiple occurrences of the same error, the first
location and the number of occurrences is shown.
If [!] is not given the first error is jumped to.
In the quickfix list, spelling errors from other
buffers are kept, so you can use something like
:argdo SpellCheck
to gather the spelling errors from multiple buffers.
:[range]SpellLCheck[!] Same as :SpellCheck, except the location list for the
current window is used instead of the quickfix list.
MAPPINGS
Inside the quickfix window, the following mappings are
remapped so that they operate on the target spell
error: zg, zG, zw, zW, zug, zuG, zuw,
zuW, z=, u
For z=, all identical misspellings in the buffer are
replaced with the chosen suggestion (via
:spellrepall).
You can also quickly undo the last spell suggestion
from the quickfix window (i.e. without switching to
the target buffer) via u.
For the other commands, the taken action is appended
to the quickfix list entry, so that the list serves as
a record of done actions (until you refresh the list
with a new :SpellCheck).
AUXILIARY COMMANDS
The following set of commands just issue an error when spelling errors exist
in the buffer or passed [range] of lines.
:BDeleteUnlessSpellError[!] :bdelete the current buffer, unless it
contains spelling errors.
:WriteUnlessSpellError[!] :write the current buffer, unless it
contains spelling errors.
:WriteDeleteUnlessSpellError[!] :write and :bdelete the current buffer,
unless it contains spelling errors.
:XitUnlessSpellError[!] :write the current buffer and :quit,
unless it contains spelling errors.
This set of commands automatically opens the quickfix list in case of spelling
error in the buffer or passed [range] of lines.
:BDeleteOrSpellCheck[!] :bdelete the current buffer, or show the
spelling errors in the quickfix list.
:WriteOrSpellCheck[!] :write the current buffer, or show the
spelling errors in the quickfix list.
:WriteDeleteOrSpellCheck[!] :write and :bdelete the current buffer,
or show the spelling errors in the quickfix
list.
:XitOrSpellCheck[!] :write the current buffer and :quit, or
show the spelling errors in the quickfix list.
:UpdateAndSpellCheck[!] :update the current buffer, and show any
spelling errors in the quickfix list.
A [!] is passed to the :write / :bdelete /
:quit commands. |
| |
| install details |
INSTALLATION
This script is packaged as a vimball. If you have the "gunzip" decompressor
in your PATH, simply edit the *.vba.gz package in Vim; otherwise, decompress
the archive first, e.g. using WinZip. Inside Vim, install by sourcing the
vimball or via the :UseVimball command.
vim SpellCheck.vba.gz
:so %
To uninstall, use the :RmVimball command.
DEPENDENCIES
- Requires Vim 7.0 or higher.
CONFIGURATION
For a permanent configuration, put the following commands into your vimrc:
If you don't want the auxiliary commands, just the core :SpellCheck command,
use:
let g:SpellCheck_DefineAuxiliaryCommands = 0
If you just want some of the auxiliary commands, or under different names, or
similar commands, you can easily define them yourself, as the core spell check
functionality is available as global autoload functions. Have a look at
plugin/SpellCheck.vim for inspiration.
If you don't want the SpellCheck-mappings that allow you to manage the spell
errors directly from the quickfix window, use:
let g:SpellCheck_DefineQuickfixMappings = 0 |
| |
script versions (upload new version)
Click on the package to download.
| SpellCheck.vba.gz |
1.20 |
2012-05-08 |
7.0 |
Ingo Karkat |
- FIX: Line range is not defined and passed for :BDeleteOrSpellCheck and other :...OrSpellCheck commands, resulting in a script error.
- ENH: Allow [range] for :BDeleteUnlessSpellError and other :...UnlessSpellError commands, too. |
| SpellCheck.vba.gz |
1.13 |
2012-05-02 |
7.0 |
Ingo Karkat |
ENH: In the quickfix list, apply undo via |u| to the target buffer to allow a quick revert of a spell correction. |
| SpellCheck.vba.gz |
1.12 |
2012-05-01 |
7.0 |
Ingo Karkat |
ENH: Allow spell checking of partial buffers by allowing [range] for :SpellCheck command. |
| SpellCheck.vba.gz |
1.11 |
2012-04-30 |
7.0 |
Ingo Karkat |
ENH: Capture corrected text and include in quickfix status message. |
| SpellCheck.vba.gz |
1.10 |
2012-04-30 |
7.0 |
Ingo Karkat |
ENH: Allow to manage the spelling errors (mark as good / bad word, globally replace with suggestion) directly from the quickfix window via the usual zg, zw, z= etc. mappings. |
| SpellCheck.vba.gz |
1.01 |
2011-12-14 |
7.0 |
Ingo Karkat |
ENH: Allow accumulating spelling errors from multiple buffers (e.g. via :argdo SpellCheck). |
| SpellCheck.vba.gz |
1.00 |
2011-12-09 |
7.0 |
Ingo Karkat |
Initial upload |
ip used for rating: 54.234.67.55
|