Skip to content

Commit

Permalink
quick jump to the closed pair
Browse files Browse the repository at this point in the history
    {
      |
    }
    (press } at |)
    {

    }|
  • Loading branch information
jiangmiao committed Dec 21, 2011
1 parent 6a4b2ca commit d0fb9fe
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions plugin/auto-pairs.vim
Expand Up @@ -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>"
Expand Down

0 comments on commit d0fb9fe

Please sign in to comment.