From f3742c74e80ce307620977053f0f5bec357b1abd Mon Sep 17 00:00:00 2001 From: Josh Sherman Date: Fri, 28 Dec 2018 23:35:33 -0600 Subject: [PATCH] Add commands and some of the replacements Still need to get my hands on a character map of the dash replacements --- plugin/dumbchars.vim | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 plugin/dumbchars.vim diff --git a/plugin/dumbchars.vim b/plugin/dumbchars.vim new file mode 100644 index 0000000..d73c1d1 --- /dev/null +++ b/plugin/dumbchars.vim @@ -0,0 +1,31 @@ +" Smart Dashes +" En Dash – => - +" Em Dash — => -- +" Figure Date ‒ => - +" Hyphen-Minus - => - +" Hyphen ‐ => - +" Minus Sign − => - + +function! DumbChars() abort + call DumbDashes() + call DumbEllipses() + call DumbQuotes() +endfunction + +function! DumbDashes() abort + +endfunction + +function! DumbEllipses() abort + %s/…/.../g +endfunction + +function! DumbQuotes() abort + %s/‘\|’/'/g + %s/“\|”/"/g +endfunction + +command! -bar DumbChars call DumbChars() +command! -bar DumbDashes call DumbDashes() +command! -bar DumbEllipses call DumbEllipses() +command! -bar DumbQuotes call DumbQuotes()