mirror of
https://github.com/preservim/vim-litecorrect.git
synced 2025-11-13 04:13:46 -05:00
Added option to disable typographic (curly) quotes.
This commit is contained in:
@@ -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
|
||||||
there’s a conflict, your correction will prevail.
|
there’s a conflict, your correction will prevail.
|
||||||
|
|
||||||
|
### Typographic characters
|
||||||
|
|
||||||
|
By default, typographic (or curly) quotes will be used in corrections. For
|
||||||
|
example:
|
||||||
|
|
||||||
|
```
|
||||||
|
Im -> I’m
|
||||||
|
shouldnt -> shouldn’t
|
||||||
|
thats -> that’s
|
||||||
|
```
|
||||||
|
|
||||||
|
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
|
||||||
|
|||||||
@@ -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 I’m
|
ia <buffer> Im I’m
|
||||||
ia <buffer> couldnt couldn’t
|
ia <buffer> couldnt couldn’t
|
||||||
ia <buffer> didnt didn’t
|
ia <buffer> didnt didn’t
|
||||||
|
|||||||
23
plugin/litecorrect.vim
Normal file
23
plugin/litecorrect.vim
Normal 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
|
||||||
|
|
||||||
Reference in New Issue
Block a user