comparison vimrc @ 224:30eb5cded521

Add parenthesis matching function
author zegervdv <zegervdv@me.com>
date Tue, 13 Jan 2015 18:57:47 +0100
parents ed108055146c
children 1d9bec72b9b3
comparison
equal deleted inserted replaced
223:ed108055146c 224:30eb5cded521
294 exec 'sleep ' . float2nr(a:blinktime * 1000) . 'm' 294 exec 'sleep ' . float2nr(a:blinktime * 1000) . 'm'
295 call matchdelete(ring) 295 call matchdelete(ring)
296 redraw 296 redraw
297 endfunction 297 endfunction
298 298
299 " Highlight matching parenthesis in different color so I don't mess up 299 " This is adapted from
300 hi MatchParen cterm=underline ctermbg=none ctermfg=white gui=underline guibg=black guifg=white 300 " http://vim.wikia.com/wiki/Windo_and_restore_current_window
301 function! KeepWin(command)
302 let currwin=winnr()
303 execute a:command
304 execute currwin . 'wincmd w'
305 endfunction
306
307 augroup insertMatch
308 au!
309 au VimEnter * NoMatchParen
310 au InsertEnter * call KeepWin("DoMatchParen")
311 au InsertLeave * call KeepWin("NoMatchParen")
312 augroup END
301 313
302 " Highlight VCS conflict markers 314 " Highlight VCS conflict markers
303 match ErrorMsg '^\(<\|=\|>\)\{7\}\([^=].\+\)\?$' 315 match ErrorMsg '^\(<\|=\|>\)\{7\}\([^=].\+\)\?$'
304 316
305 " Swap v and CTRL-V 317 " Swap v and CTRL-V