Allow for expansion of default entries #5

This commit is contained in:
Reed Esau
2015-12-25 13:59:49 -07:00
parent d8a55e73ee
commit c348095afc
2 changed files with 29 additions and 9 deletions

View File

@@ -10,12 +10,27 @@ Features of this plugin:
* Focused on the most common of typos
* Pure Vimscript using the efficient `iabbrev`
* Included auto-correct entries limited to 300 for fast loading
* Included auto-correct entries limited to 350 (in 2016) to ensure fast
loading (see **new** expansion policy below)
* Buffer-scoped behavior (wont touch global settings)
Note that this plugin is not intended to be a replacement for teh spell
checker in Vim. Its best used with spell-check enabled.
## Expansion policy (**NEW**)
Since it was created in 2013, _litecorrect_ has limited the number of
default auto-correct entries (such as `teh`->`the`) to 300, avoiding the
excessive load times of comparable plugins and focusing on the most common
of typos.
Meanwhile, the adoption of new disk technologies reduces the penalty we
pay when initializing plugins. This provides _litecorrect_ an opportunity
to grow while not significantly impacting load-time performance.
Henceforth, _litecorrect_ will expand by up to 50 entries each year. For
2016 it will grow to 350 entries. For 2017, 400 entries, and so on.
## Requirements
May require a recent version of Vim.
@@ -65,8 +80,8 @@ theres a conflict, your correction will prevail.
### Correct previous misspelling
To augment _litecorrect_ you may find the following key mapping useful.
It forces the top-ranked correction on the first misspelled word
before the cursor.
It forces the top-ranked correction on the first misspelled word
before the cursor.
Add to your `.vimrc` with a key mapping of your choice:
@@ -75,7 +90,7 @@ nnoremap <C-s> [s1z=<c-o>
inoremap <C-s> <c-g>u<Esc>[s1z=`]A<c-g>u
```
It generates a fresh undo point prior to the correction so
It generates a fresh undo point prior to the correction so
that you can conveniently undo if necessary.
Note that _litecorrect_ does not map any keys.
@@ -100,7 +115,7 @@ shouldn't -> shouldnt
that's -> thats
```
## Criteria to modify default entries
## Criteria to add (or modify) default entries
Note that the number of default entries will be limited to 300 for fast
loading.
@@ -111,16 +126,17 @@ will replace.
## Related projects
For a more comprehensive approach with _many_ more entries, check out:
If load time performance isnt an issue, you may seek a more
comprehensive approach:
* [wordlist.vim](https://github.com/vim-scripts/wordlist.vim) - nearly 800 entries
* [vim-autocorrect](https://github.com/panozzaj/vim-autocorrect) - over 12K entries!
A warning that larger entry counts make for slower loading.
An alternative that builds on [tpope/vim-abolish][va]:
Another approach that builds on [tpope/vim-abolish]:
* [vim-correction](https://github.com/jdelkins/vim-correction) - approx. 700 entries
* [vim-correction](https://github.com/jdelkins/vim-correction)
[va]: http://github.com/tpope/vim-abolish
## See also

View File

@@ -119,6 +119,7 @@ function! litecorrect#init(...)
ia <buffer> hsi his
ia <buffer> htat that
ia <buffer> hte the
ia <buffer> htem them
ia <buffer> hten then
ia <buffer> htere there
ia <buffer> htese these
@@ -173,6 +174,7 @@ function! litecorrect#init(...)
ia <buffer> mkea make
ia <buffer> moeny money
ia <buffer> mroe more
ia <buffer> msut must
ia <buffer> mysefl myself
ia <buffer> myu my
ia <buffer> nad and
@@ -235,6 +237,7 @@ function! litecorrect#init(...)
ia <buffer> thast that
ia <buffer> thats that's
ia <buffer> thatthe that the
ia <buffer> theh then
ia <buffer> theri their
ia <buffer> thgat that
ia <buffer> thge the
@@ -312,6 +315,7 @@ function! litecorrect#init(...)
ia <buffer> yaer year
ia <buffer> yera year
ia <buffer> yoiu you
ia <buffer> yoru your
ia <buffer> youare you are
ia <buffer> youre you're
ia <buffer> youve you've