a
- inoremap ( ()<esc>:call BC_AddChar(")")<cr>i
- inoremap { {<cr>}<esc>:call BC_AddChar("}")<cr><esc>kA<cr>
- inoremap [ []<esc>:call BC_AddChar("]")<cr>i
- inoremap " ""<esc>:call BC_AddChar(""")<cr>i
- " jump out of parenthesis
- inoremap <C-j> <esc>:call search(BC_GetChar(), "W")<cr>a
-
- function! BC_AddChar(schar)
- if exists("b:robstack")
- let b:robstack = b:robstack . a:schar
- else
- let b:robstack = a:schar
- endif
- endfunction
-
- function! BC_GetChar()
- let l:char = b:robstack[strlen(b:robstack)-1]
- let b:robstack = strpart(b:robstack, 0, strlen(b:robstack)-1)
- return l:char
- endfunction
点击Count()
回复Comments
{commenttime}{commentauthor}
{CommentUrl}
{commentcontent}