# HG changeset patch # User Steve Losh # Date 1320027685 14400 # Node ID 799b6f1a5205aa4481a172910531ce4d0826ffa1 # Parent 30835aec3aee9a5390bd2cea3e70992feb61f939 Hell yeah, CursorLine pulsing! diff -r 30835aec3aee -r 799b6f1a5205 vim/.vimrc --- a/vim/.vimrc Sun Oct 30 15:51:24 2011 -0400 +++ b/vim/.vimrc Sun Oct 30 22:21:25 2011 -0400 @@ -205,9 +205,10 @@ " Made D behave nnoremap D d$ -" Keep search matches in the middle of the window. -nnoremap n nzzzv -nnoremap N Nzzzv +" Keep search matches in the middle of the window and pulse the line when moving +" to them. +nnoremap n nzzzv:call PulseCursorLine() +nnoremap N Nzzzv:call PulseCursorLine() " Don't move on * nnoremap * * @@ -1454,3 +1455,50 @@ command! NyanMe call NyanMe() " }}} +" Pulse ------------------------------------------------------------------- {{{ + +function! PulseCursorLine() + let current_window = winnr() + + windo set nocursorline + execute current_window . 'wincmd w' + + setlocal cursorline + + redir => old_hi + silent execute 'hi CursorLine' + redir END + let old_hi = split(old_hi, '\n')[0] + let old_hi = substitute(old_hi, 'xxx', '', '') + + hi CursorLine guibg=#2a2a2a + redraw + sleep 30m + + hi CursorLine guibg=#333333 + redraw + sleep 30m + + hi CursorLine guibg=#3a3a3a + redraw + sleep 30m + + hi CursorLine guibg=#444444 + redraw + sleep 30m + + hi CursorLine guibg=#4a4a4a + redraw + sleep 30m + + hi CursorLine guibg=#555555 + redraw + sleep 30m + + execute 'hi ' . old_hi + + windo set cursorline + execute current_window . 'wincmd w' +endfunction + +" }}}