bairui

puke

May 28th, 2011
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 0.64 KB | None | 0 0
  1. " puke.vim - colour me horridly
  2. " Barry Arthur, May 2011
  3.  
  4. highlight puke_sentence ctermfg=grey ctermbg=green
  5. highlight puke_line     ctermfg=grey ctermbg=yellow
  6. highlight puke_word     ctermfg=grey ctermbg=red
  7.  
  8. let s:last_sentence = 0
  9. let s:last_line = 0
  10. function! Puke()
  11.   if s:last_sentence
  12.     call matchdelete(s:last_sentence)
  13.   endif
  14.   if s:last_line
  15.     call matchdelete(s:last_line)
  16.   endif
  17.   let s:last_line = matchadd('puke_line', '\%' . line('.') . 'l.*')
  18.   let s:last_sentence = matchadd('puke_sentence', '\_.*\.\s\+\zs\_.*\%#\_.\{-}\.')
  19.   call matchadd('puke_word', '\<\w*\%#\w*\>')
  20. endfunction
  21.  
  22. au CursorHold * call Puke()
Advertisement
Add Comment
Please, Sign In to add comment