NEW support ```, ''', """
This commit is contained in:
parent
6c3bcbca50
commit
10f56aad0e
10
README.md
10
README.md
@ -70,6 +70,14 @@ Features
|
||||
|
||||
}|
|
||||
|
||||
* Support ``` ''' and """
|
||||
|
||||
input:
|
||||
'''
|
||||
|
||||
output:
|
||||
'''
|
||||
|
||||
Shortcuts
|
||||
---------
|
||||
|
||||
@ -89,7 +97,7 @@ Options
|
||||
-------
|
||||
* g:AutoPairs
|
||||
|
||||
Default: {'(':')', '[':']', '{':'}',"'":"'",'"':'"'}
|
||||
Default: {'(':')', '[':']', '{':'}',"'":"'",'"':'"', '`':'`'}
|
||||
|
||||
* g:AutoPairsShortcutToggle
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Insert or delete brackets, parens, quotes in pairs.
|
||||
" Maintainer: JiangMiao <jiangfriend@gmail.com>
|
||||
" Contributor: camthompson
|
||||
" Last Change: 2011-12-29
|
||||
" Last Change: 2012-01-17
|
||||
" Version: 1.1.4
|
||||
" Homepage: http://www.vim.org/scripts/script.php?script_id=3599
|
||||
" Repository: https://github.com/jiangmiao/auto-pairs
|
||||
@ -116,6 +116,16 @@ function! AutoPairsInsert(key)
|
||||
return a:key
|
||||
end
|
||||
|
||||
" support for ''' ``` and """
|
||||
if open == close
|
||||
" The key must be ' " `
|
||||
let pprev_char = line[col('.')-3]
|
||||
if pprev_char == open && prev_char == open
|
||||
" Double pair found
|
||||
return a:key
|
||||
end
|
||||
end
|
||||
|
||||
return open.close."\<Left>"
|
||||
endfunction
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user