Skip to content

Instantly share code, notes, and snippets.

@michiel
Last active December 16, 2015 15:39
Show Gist options
  • Save michiel/5457281 to your computer and use it in GitHub Desktop.
Save michiel/5457281 to your computer and use it in GitHub Desktop.
vim color test script for ~/.vim/plugin
function! VimColorTest(outfile, fgend, bgend)
let result = []
for fg in range(a:fgend)
for bg in range(a:bgend)
let kw = printf('%-7s', printf('c_%d_%d', fg, bg))
let h = printf('hi %s ctermfg=%d ctermbg=%d', kw, fg, bg)
let s = printf('syn keyword %s %s', kw, kw)
call add(result, printf('%-32s | %s', h, s))
endfor
endfor
call writefile(result, a:outfile)
execute 'edit '.a:outfile
source %
endfunction
" Increase numbers in next line to see more colors.
command! VimColorTest call VimColorTest('vim-color-test.tmp', 1, 256)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment