All Projects → reedes → Vim Litecorrect

reedes / Vim Litecorrect

Licence: other
Lightweight auto-correction for Vim

Projects that are alternatives of or similar to Vim Litecorrect

vim-textobj-sentence
Improving on Vim's native sentence text object and motion
Stars: ✭ 92 (+19.48%)
Mutual labels:  vim-plugin, writing
Vim Lexical
Build on Vim’s spell/thes/dict completion
Stars: ✭ 223 (+189.61%)
Mutual labels:  vim-plugin, writing
vim-textobj-quote
Use ‘curly’ quote characters in Vim
Stars: ✭ 112 (+45.45%)
Mutual labels:  vim-plugin, writing
vim-colors-pencil
Light (& dark) color scheme inspired by iA Writer
Stars: ✭ 564 (+632.47%)
Mutual labels:  vim-plugin, writing
Vim Pencil
Rethinking Vim as a tool for writing
Stars: ✭ 1,186 (+1440.26%)
Mutual labels:  vim-plugin, writing
Vim Colors Pencil
Light (& dark) color scheme inspired by iA Writer
Stars: ✭ 498 (+546.75%)
Mutual labels:  vim-plugin, writing
vim-wordy
Uncover usage problems in your writing
Stars: ✭ 677 (+779.22%)
Mutual labels:  vim-plugin, writing
Vim Wordy
Uncover usage problems in your writing
Stars: ✭ 645 (+737.66%)
Mutual labels:  vim-plugin, writing
Tabnine
AI Code Completions
Stars: ✭ 8,863 (+11410.39%)
Mutual labels:  vim-plugin
Tcomment vim
An extensible & universal comment vim-plugin that also handles embedded filetypes
Stars: ✭ 1,162 (+1409.09%)
Mutual labels:  vim-plugin
Vimagit
Ease your git workflow within Vim
Stars: ✭ 1,088 (+1312.99%)
Mutual labels:  vim-plugin
Vim Yaml Folds
YAML, RAML, EYAML & SaltStack SLS folding for Vim
Stars: ✭ 59 (-23.38%)
Mutual labels:  vim-plugin
Asblocks
Share content as blocks
Stars: ✭ 70 (-9.09%)
Mutual labels:  writing
Vim Systemd Syntax
Syntax highlighting for systemd service files in Vim.
Stars: ✭ 57 (-25.97%)
Mutual labels:  vim-plugin
Fzf Filemru
File MRU with fzf.vim
Stars: ✭ 76 (-1.3%)
Mutual labels:  vim-plugin
Vim Package Info
Vim plugin to quickly view info about the packages you use
Stars: ✭ 57 (-25.97%)
Mutual labels:  vim-plugin
Plotto
Plot suggestions for writers of creative fiction
Stars: ✭ 55 (-28.57%)
Mutual labels:  writing
Markdownmonster
An extensible Markdown Editor, Viewer and Weblog Publisher for Windows
Stars: ✭ 1,203 (+1462.34%)
Mutual labels:  writing
Hunspell
The most popular spellchecking library.
Stars: ✭ 1,196 (+1453.25%)
Mutual labels:  spellcheck
Completor.vim
Async completion framework made ease.
Stars: ✭ 1,158 (+1403.9%)
Mutual labels:  vim-plugin

vim-litecorrect

Lightweight auto-correction for Vim

We type teh when we meant to type the. This plugin is to help us catch the most common of these typos and correct each upon hitting the space bar (or non-keyword character.)

Features of this plugin:

  • Focused on the most common of typos
  • Pure Vimscript using the efficient iabbrev
  • Included auto-correct entries limited to 350 (in 2016) to ensure fast loading (see 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

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.

Installation

litecorrect is best installed using a Vim package manager, such as Vundle, Plug, NeoBundle, or Pathogen.

Configuration

Because you may not want auto-corrections in all file types you edit, you can configure this plugin per file type. For example, to enable litecorrect support in markdown and textile files, place in your .vimrc:

set nocompatible
filetype plugin on       " may already be in your .vimrc

augroup litecorrect
  autocmd!
  autocmd FileType markdown,mkd call litecorrect#init()
  autocmd FileType textile call litecorrect#init()
augroup END

Optionally, you can build on the defaults by providing your own corrections. Note that the corrections are stored as key-value entries where the value is a list of the common misspellings for the key.

let user_dict = {
  \ 'maybe': ['mabye'],
  \ 'medieval': ['medival', 'mediaeval', 'medevil'],
  \ 'then': ['hten'],
  \ }
augroup litecorrect
  autocmd!
  autocmd FileType markdown call litecorrect#init(user_dict)
  autocmd FileType textile call litecorrect#init(user_dict)
augroup END

The corrections you provide will be in addition to the defaults. Where 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.

Add to your .vimrc with a key mapping of your choice:

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 that you can conveniently undo if necessary.

Note that litecorrect does not map any keys.

Typographic characters

By default, straight quotes will be used in corrections. For example:

Im -> I'm
shouldnt -> shouldn't
thats -> that's

If you prefer typographic (“curly”) quotes, install an educating quote plugin like vim-textobj-quote that will automatically transform straight quotes to curly ones in your typing, including your corrections. For example:

I'm -> I’m
shouldn't -> shouldn’t
that's -> that’s

Criteria to add (or modify) default entries

Note that the number of default entries will be limited for fast loading. See policy above.

Suggestions for improving the defaults are welcome, but good evidence is needed that a suggested auto-correct entry adds value to the list.

Related projects

If load time performance isn’t an issue, you can seek a more comprehensive approach:

An alternative that builds on tpope/vim-abolish:

See also

If you find this plugin useful, you may want to check out these others by @reedes:

  • vim-colors-pencil - color scheme for Vim inspired by IA Writer
  • vim-lexical - building on Vim’s spell-check and thesaurus/dictionary completion
  • vim-one - make use of Vim’s +clientserver capabilities
  • vim-pencil - rethinking Vim as a tool for writers
  • vim-textobj-quote - extends Vim to support typographic (‘curly’) quotes
  • vim-textobj-sentence - improving on Vim's native sentence motion command
  • vim-thematic - modify Vim’s appearance to suit your task and environment
  • vim-wheel - screen-anchored cursor movement for Vim
  • vim-wordy - uncovering usage problems in writing
  • vim-wordchipper - power tool for shredding text in Insert mode

Future development

If you’ve spotted a problem or have an idea on improving this plugin, please post it to the github project issue page.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].