From c348095afc326364015f3f7e8d9844ab8bc37d69 Mon Sep 17 00:00:00 2001 From: Reed Esau Date: Fri, 25 Dec 2015 13:59:49 -0700 Subject: [PATCH] Allow for expansion of default entries #5 --- README.markdown | 34 +++++++++++++++++++++++++--------- autoload/litecorrect.vim | 4 ++++ 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/README.markdown b/README.markdown index 6c82dbe..788c2f4 100644 --- a/README.markdown +++ b/README.markdown @@ -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 (won’t touch global settings) Note that this plugin is not intended to be a replacement for teh spell checker in Vim. It’s 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 @@ there’s 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 [s1z= inoremap u[s1z=`]Au ``` -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 -> shouldn’t that's -> that’s ``` -## 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 isn’t 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 diff --git a/autoload/litecorrect.vim b/autoload/litecorrect.vim index 64e6159..49f58ff 100644 --- a/autoload/litecorrect.vim +++ b/autoload/litecorrect.vim @@ -119,6 +119,7 @@ function! litecorrect#init(...) ia hsi his ia htat that ia hte the + ia htem them ia hten then ia htere there ia htese these @@ -173,6 +174,7 @@ function! litecorrect#init(...) ia mkea make ia moeny money ia mroe more + ia msut must ia mysefl myself ia myu my ia nad and @@ -235,6 +237,7 @@ function! litecorrect#init(...) ia thast that ia thats that's ia thatthe that the + ia theh then ia theri their ia thgat that ia thge the @@ -312,6 +315,7 @@ function! litecorrect#init(...) ia yaer year ia yera year ia yoiu you + ia yoru your ia youare you are ia youre you're ia youve you've