diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1c8dfa3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +*.sw? +*.vba +*.zip +*.gz +vimball.txt diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4bad548 --- /dev/null +++ b/Makefile @@ -0,0 +1,15 @@ +PLUGIN=delimitMate + +install: + cp -f doc/* ~/.vim/doc/${PLUGIN}.txt + cp -f plugin/* ~/.vim/plugin/${PLUGIN}.vim + vim -u NONE -c 'helptags ~/.vim/doc' -c 'q' + +zip: + zip -r pickacolor.zip doc plugin + zip pickacolor.zip -d \*.sw\? + +vimball: install + echo doc/${PLUGIN}.txt > vimball.txt + echo plugin/${PLUGIN}.vim >> vimball.txt + vim -c 'e vimball.txt' -c '%MkVimball! ${PLUGIN}' -c 'q' diff --git a/plugin/delimitMate.vim b/plugin/delimitMate.vim index 83e9c30..eeef0b6 100644 --- a/plugin/delimitMate.vim +++ b/plugin/delimitMate.vim @@ -147,7 +147,8 @@ function! s:Init() "{{{1 endif " }}} if !exists("b:delimitMate_apostrophes") && !exists("g:delimitMate_apostrophes") " {{{ - let s:apostrophes = split("n't:'s:'re:'m:'d:'ll:'ve:s'",':') + "let s:apostrophes = split("n't:'s:'re:'m:'d:'ll:'ve:s'",':') + let s:apostrophes = [] elseif exists("b:delimitMate_apostrophes") let s:apostrophes = split(b:delimitMate_apostrophes) @@ -170,7 +171,7 @@ function! s:Init() "{{{1 call s:ExtraMappings() let b:loaded_delimitMate = 1 -endfunction "}}}1 +endfunction "}}}1 Init() function! s:ValidMatchpairs(str) "{{{1 if a:str !~ '^.:.\(,.:.\)*$' @@ -229,6 +230,13 @@ function! s:QuoteDelim(char) "{{{1 if line[col - 2] == "\\" " Seems like a escaped character, insert a single quotation mark. return a:char + elseif line[col - 2] == a:char && line[col - 1 ] != a:char + " Seems like we have an unbalanced quote, insert a single + " quotation mark. + return a:char."\" + elseif a:char == "'" && line[col -2 ] =~ '[a-zA-Z0-9]' + " Seems like we follow a word, insert an apostrophe. + return a:char elseif line[col - 1] == a:char " Get out of the string. return "\"