quick jump to the closed pair

{
      |
    }
    (press } at |)
    {

    }|
This commit is contained in:
jiangfriend@gmail.com 2011-12-21 18:26:26 +08:00
parent 6a4b2ca820
commit d0fb9fe72b

View File

@ -84,6 +84,16 @@ function! AutoPairsInsert(key)
return "\<Right>\<Right>"
end
" Skip the character if next
if next_char == ''
let next_lineno = line('.')+1
let next_line = getline(nextnonblank(next_lineno))
let next_char = matchstr(next_line, '\s*\zs.')
if next_char == a:key
return "\<ESC>e^a"
endif
endif
" Skip the character if current character is the same as input
if current_char == a:key
return "\<Right>"