Added option to disable typographic (curly) quotes.

This commit is contained in:
Reed Esau
2014-02-04 01:01:06 -07:00
parent 3df19f9fdf
commit bf70b0d893
3 changed files with 44 additions and 1 deletions

View File

@@ -64,6 +64,26 @@ where the value is a list of the common misspellings for the key.
The corrections you provide will be in addition to the defaults. Where The corrections you provide will be in addition to the defaults. Where
theres a conflict, your correction will prevail. theres a conflict, your correction will prevail.
### Typographic characters
By default, typographic (or curly) quotes will be used in corrections. For
example:
```
Im -> Im
shouldnt -> shouldnt
thats -> thats
```
If you prefer straight quotes, change this setting to 0 in your `.vimrc`:
```
let g:litecorrect#typographic = 1 " 0=disable, 1=enable (def)
```
Note that an educating quote plugin like _quotable_ (see below) will
automatically transform straight quotes to curly ones in your corrections.
## Criteria to modify default entries ## Criteria to modify default entries
Note that the number of default entries will be limited to 300 for fast Note that the number of default entries will be limited to 300 for fast

View File

@@ -307,7 +307,7 @@ function! litecorrect#init(...)
ia <buffer> yuo you ia <buffer> yuo you
ia <buffer> yuor your ia <buffer> yuor your
if s:unicode_enabled() if s:unicode_enabled() && g:litecorrect#typographic
ia <buffer> Im Im ia <buffer> Im Im
ia <buffer> couldnt couldnt ia <buffer> couldnt couldnt
ia <buffer> didnt didnt ia <buffer> didnt didnt

23
plugin/litecorrect.vim Normal file
View File

@@ -0,0 +1,23 @@
" =============================================================================
" File: plugin/litecorrect.vim
" Description: lightweight autocorrection for Vim
" Maintainer: Reed Esau <github.com/reedes>
" Created: January 20, 2014
" License: The MIT License (MIT)
" =============================================================================
if exists('g:loaded_litecorrect') || &cp | finish | endif
let g:loaded_litecorrect = 1
" Save 'cpoptions' and set Vim default to enable line continuations.
let s:save_cpo = &cpo
set cpo&vim
if !exists('g:litecorrect#typographic')
let g:litecorrect#typographic = 1 " 0=disable, 1=enable
endif
let &cpo = s:save_cpo
unlet s:save_cpo
" vim:ts=2:sw=2:sts=2