Files
vim-litecorrect/README.markdown
Reed Esau db71640977 first cut
2013-12-29 01:37:12 -07:00

99 lines
2.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 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.
Features of this plugin:
* Focused on the most common of typos that we make
* Uses Vims `iabbrev`
* Buffer-scoped
* User-extendable
Note that this plugin is not a replacement for teh spell checker in Vim.
This plugin defines the most common typos we make along with their corrections:
```
let g:litecorrect#defaults =
\{'I' : ['i'],
\ 'The' : ['TEh', 'Teh'],
\ 'that' : ['htat'],
\ 'the' : ['hte', 'teh'],
\ 'this' : ['htis'],
\ 'then' : ['tehn'],
\ 'what' : ['waht'],
\}
```
Note that the corrections are the keys, with the misspellings for each stored
in a list.
## Requirements
May require a recent version of Vim.
## Installation
Install using Pathogen, Vundle, Neobundle, or your favorite Vim package
manager.
## 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`:
```vim
augroup litecorrect
autocmd!
autocmd FileType markdown call litecorrect#init()
autocmd FileType textile call litecorrect#init()
augroup END
```
Alternatively, you can build on the defaults by provide your own corrections:
```
let user_dict = {
\ 'maybe': ['mabye'],
\ 'medieval': ['medival', 'mediaeval', 'medevil'],
\ 'then': ['hten'],
\ }
augroup litecorrect
autocmd!
autocmd FileType markdown call litecorrect#init(user_dict)
augroup END
```
The corrections you provide will be in addition to those in those in
`g:litecorrect#defaults`. Where theres a conflict, your correction will
prevail.
## Criteria to add to defaults
Suggestions for adding to the defaults are welcome, but good evidence is
needed that they are common typos.
## See also
For a more comprehensive approach, check out
[vim-autocorrect](https://github.com/panozzaj/vim-autocorrect).
If you like this plugin, you may like these other ones from the same author:
* [vim-quotable](http://github.com/reedes/vim-quotable) - extends Vim to
support typographic (curly) quotes
* [vim-writer](http://github.com/reedes/vim-writer) - Extending Vim to better
support writing prose and documentation
## Future development
If you have any ideas on improving this plugin, please post them to the github
project issue page.
<!-- vim: set tw=74 :-->