Created
March 8, 2019 08:48
-
-
Save pocke/96b0bd39ce71a80735920ee48e7360c3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| 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