Skip to content

Instantly share code, notes, and snippets.

@pocke
Created March 8, 2019 08:48
Show Gist options
  • Select an option

  • Save pocke/96b0bd39ce71a80735920ee48e7360c3 to your computer and use it in GitHub Desktop.

Select an option

Save pocke/96b0bd39ce71a80735920ee48e7360c3 to your computer and use it in GitHub Desktop.
function! Rainbow(_) abort
let colors = ['Blue', "Green", "Cyan", "Red", "Magenta", "Yellow"]
let groups = ['Normal', 'Constant', 'Identifier', 'Statement', 'Special']
let offset = g:rainbow_idx % len(colors)
let idx = 0
for g in groups
let color = colors[(idx + offset) % len(colors)]
execute "hi " . g . " ctermfg=" . color
let idx += 1
endfor
let g:rainbow_idx = offset + 1
endfunction
function! StartRainbow() abort
let g:rainbow_idx = 0
call timer_start(100, 'Rainbow', {'repeat': -1})
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment