From d0fb9fe72becae7c965934b00f3a77dbfa5da15d Mon Sep 17 00:00:00 2001 From: "jiangfriend@gmail.com" Date: Wed, 21 Dec 2011 18:26:26 +0800 Subject: [PATCH] quick jump to the closed pair { | } (press } at |) { }| --- plugin/auto-pairs.vim | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugin/auto-pairs.vim b/plugin/auto-pairs.vim index c17ec78..5b503bc 100644 --- a/plugin/auto-pairs.vim +++ b/plugin/auto-pairs.vim @@ -84,6 +84,16 @@ function! AutoPairsInsert(key) return "\\" 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 "\e^a" + endif + endif + " Skip the character if current character is the same as input if current_char == a:key return "\"