add contributor list

This commit is contained in:
jiangfriend@gmail.com 2011-12-29 21:42:43 +08:00
parent e62479a542
commit 7e4614d6aa
2 changed files with 18 additions and 7 deletions

View File

@ -36,6 +36,11 @@ Features
input: '|' (press <SPACE> at |) input: '|' (press <SPACE> at |)
output: ' |' output: ' |'
* Skip ' when inside a word
input: foo| (press ' at |)
output: foo'
* Skip closed bracket. * Skip closed bracket.
input: [] input: []
@ -155,4 +160,7 @@ TroubleShooting
3. use DEL or <C-O>x to delete the character insert by plugin. 3. use DEL or <C-O>x to delete the character insert by plugin.
Contributors
------------
* [camthompson](https://github.com/camthompson)

View File

@ -1,7 +1,8 @@
" Insert or delete brackets, parens, quotes in pairs. " Insert or delete brackets, parens, quotes in pairs.
" Maintainer: JiangMiao <jiangfriend@gmail.com> " Maintainer: JiangMiao <jiangfriend@gmail.com>
" Last Change: 2011-12-13 " Contributor: camthompson
" Version: 1.1.3 " Last Change: 2011-12-29
" Version: 1.1.4
" Homepage: http://www.vim.org/scripts/script.php?script_id=3599 " Homepage: http://www.vim.org/scripts/script.php?script_id=3599
" Repository: https://github.com/jiangmiao/auto-pairs " Repository: https://github.com/jiangmiao/auto-pairs
@ -77,6 +78,11 @@ function! AutoPairsInsert(key)
return a:key return a:key
end end
" Ignore ' if follows a word
if a:key == "'" && prev_char =~ '\v\w'
return a:key
end
if !has_key(g:AutoPairs, a:key) if !has_key(g:AutoPairs, a:key)
" Skip the character if next character is space " Skip the character if next character is space
@ -110,10 +116,7 @@ function! AutoPairsInsert(key)
return "\<Right>" return "\<Right>"
end end
if a:key == "'" && prev_char =~ '\v\w' return open.close."\<Left>"
return a:key
else
return open.close."\<Left>"
endfunction endfunction
function! AutoPairsDelete() function! AutoPairsDelete()