Created
April 3, 2013 16:04
-
-
Save mmisono/5302557 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
augroup ColorColumn | |
autocmd! | |
augroup END | |
function! s:startChangeCC() | |
autocmd ColorColumn CursorMoved * call s:changeColorColumn() | |
autocmd ColorColumn CursorMovedI * call s:changeColorColumn() | |
endfunction | |
function! s:endChangeCC() | |
augroup ColorColumn | |
autocmd! | |
augroup END | |
setl cc=0 | |
endfunction | |
function! s:changeColorColumn() | |
let width = winwidth(0) | |
let match_end = matchend(reltimestr(reltime()), '\d\+\.') + 1 | |
let rand = reltimestr(reltime())[match_end : ] % (width + 1) | |
exe "setl cc=".rand | |
endfunction | |
command! StartChangeCC call s:startChangeCC() | |
command! EndChangeCC call s:endChangeCC() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment