From 25e9569e6a6507b4c51edb8eb8f0128b193f1aba Mon Sep 17 00:00:00 2001 From: Reed Esau Date: Fri, 15 Aug 2014 01:49:08 -0600 Subject: [PATCH] Simplified by removing curly-quote support Such support is best provided by an educating quote plugin. --- README.markdown | 28 +++++++++++------------ autoload/litecorrect.vim | 49 +++++++++++++--------------------------- plugin/litecorrect.vim | 4 ---- 3 files changed, 30 insertions(+), 51 deletions(-) diff --git a/README.markdown b/README.markdown index e772073..731aedb 100644 --- a/README.markdown +++ b/README.markdown @@ -64,24 +64,24 @@ there’s a conflict, your correction will prevail. ### Typographic characters -By default, typographic (or curly) quotes will be used in corrections. For -example: +By default, straight quotes will be used in corrections. For example: ``` -Im -> I’m -shouldnt -> shouldn’t -thats -> that’s +Im -> I'm +shouldnt -> shouldn't +thats -> that's ``` -If you prefer straight quotes, change this setting to 0 in your `.vimrc`: +If you prefer typographic (“curly”) quotes, install an educating quote plugin +like [vim-textobj-quote][qu] that will automatically transform straight quotes +to curly ones in your typing, including your corrections. For example: ``` -let g:litecorrect#typographic = 1 " 0=disable, 1=enable (def) +I'm -> I’m +shouldn't -> shouldn’t +that's -> that’s ``` -Note that an educating quote plugin like [vim-textobj-quote][qu] will -automatically transform straight quotes to curly ones in your corrections. - ## Criteria to modify default entries Note that the number of default entries will be limited to 300 for fast @@ -96,7 +96,7 @@ will replace. For a more comprehensive approach with _many_ more entries, check out: * [wordlist.vim](https://github.com/vim-scripts/wordlist.vim) - nearly 800 entries -* [vim-autocorrect](https://github.com/panozzaj/vim-autocorrect) - over 12K entries! +* [vim-autocorrect](https://github.com/panozzaj/vim-autocorrect) - over 12K entries! A warning that larger entry counts make for slower loading. @@ -107,13 +107,13 @@ If you find this plugin useful, you may want to check out these others by * [vim-colors-pencil][cp] - color scheme for Vim inspired by IA Writer * [vim-lexical][lx] - building on Vim’s spell-check and thesaurus/dictionary completion -* [vim-one][vo] - make use of Vim’s _+clientserver_ capabilities +* [vim-one][vo] - make use of Vim’s _+clientserver_ capabilities * [vim-pencil][pn] - rethinking Vim as a tool for writers * [vim-textobj-quote][qu] - extends Vim to support typographic (‘curly’) quotes * [vim-textobj-sentence][ts] - improving on Vim's native sentence motion command -* [vim-thematic][th] - modify Vim’s appearance to suit your task and environment +* [vim-thematic][th] - modify Vim’s appearance to suit your task and environment * [vim-wheel][wh] - screen-anchored cursor movement for Vim -* [vim-wordy][wo] - uncovering usage problems in writing +* [vim-wordy][wo] - uncovering usage problems in writing [re]: http://github.com/reedes [cp]: http://github.com/reedes/vim-colors-pencil diff --git a/autoload/litecorrect.vim b/autoload/litecorrect.vim index 27eaca7..d960777 100644 --- a/autoload/litecorrect.vim +++ b/autoload/litecorrect.vim @@ -18,13 +18,12 @@ function! s:unicode_enabled() endfunction function! litecorrect#init(...) + ia Im I'm ia TEh The ia Teh The ia abotu about ia acn can ia adn and - ia anf and - ia ans and ia agian again ia ahppen happen ia ahve have @@ -46,7 +45,9 @@ function! litecorrect#init(...) ia amkes makes ia andteh and the ia andthe and the + ia anf and ia anothe another + ia ans and ia arond around ia asthe as the ia atthe at the @@ -77,15 +78,19 @@ function! litecorrect#init(...) ia comtain contain ia comtains contains ia coudl could + ia couldnt couldn't ia couldthe could the ia cpoy copy ia deatils details ia didnot did not + ia didnt didn't ia doese does + ia doesnt doesn't ia doign doing ia doimg doing ia donid doing ia donig doing + ia dont don't ia efel feel ia ehr her ia esle else @@ -112,6 +117,7 @@ function! litecorrect#init(...) ia hadbeen had been ia haev have ia hasbeen has been + ia hasnt hasn't ia havebeen have been ia haveing having ia hda had @@ -184,6 +190,7 @@ function! litecorrect#init(...) ia oneof one of ia onthe on the ia onyl only + ia ot to ia otehr other ia otu out ia outof out of @@ -207,6 +214,7 @@ function! litecorrect#init(...) ia seh she ia shesaid she said ia shoudl should + ia shouldnt shouldn't ia showinf showing ia simalar similar ia similiar similar @@ -234,10 +242,13 @@ function! litecorrect#init(...) ia tghe the ia tghis this ia thansk thanks + ia thats that's ia thatthe that the ia thenew the new ia theri their ia thesame the same + ia theyll they'll + ia theyve they've ia thgat that ia thge the ia thier their @@ -258,7 +269,6 @@ function! litecorrect#init(...) ia tkae take ia tkaes takes ia tkaing taking - ia ot to ia todya today ia tothe to the ia towrad toward @@ -271,6 +281,7 @@ function! litecorrect#init(...) ia veyr very ia vrey very ia waht what + ia wasnt wasn't ia watn want ia wehn what ia werre were @@ -294,6 +305,7 @@ function! litecorrect#init(...) ia wokr work ia woudl would ia wouldbe would be + ia wouldnt wouldn't ia wrod word ia wroet wrote ia wtih with @@ -302,40 +314,11 @@ function! litecorrect#init(...) ia yera year ia yoiu you ia youare you are + ia youve you've ia ytou you ia yuo you ia yuor your - if s:unicode_enabled() && g:litecorrect#typographic - ia Im I’m - ia couldnt couldn’t - ia didnt didn’t - ia doesnt doesn’t - ia dont don’t - ia hasnt hasn’t - ia shouldnt shouldn’t - ia thats that’s - ia theyll they’ll - ia theyve they’ve - ia wasnt wasn’t - ia wouldnt wouldn’t - ia youve you’ve - else - ia Im I'm - ia couldnt couldn't - ia didnt didn't - ia doesnt doesn't - ia dont don't - ia hasnt hasn't - ia shouldnt shouldn't - ia thats that's - ia theyll they'll - ia theyve they've - ia wasnt wasn't - ia wouldnt wouldn't - ia youve you've - endif - " user overrides let l:user_dict = a:0 ? a:1 : {} for l:item in items(l:user_dict) diff --git a/plugin/litecorrect.vim b/plugin/litecorrect.vim index 4edfb53..d630f0d 100644 --- a/plugin/litecorrect.vim +++ b/plugin/litecorrect.vim @@ -13,10 +13,6 @@ let g:loaded_litecorrect = 1 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