Skip to content

Instantly share code, notes, and snippets.

@ajalab
Created April 1, 2013 10:06
Show Gist options
  • Save ajalab/5284101 to your computer and use it in GitHub Desktop.
Save ajalab/5284101 to your computer and use it in GitHub Desktop.
"ColorTester (for 256colors terminal)
"cf: http://vim.wikia.com/wiki/View_all_colors_available_to_gvim
function! VimColorTest(outfile, fgend)
let result = []
for fg in range(a:fgend)
let kw = printf('%s', printf('c_%d', fg))
let h = printf('hi %s ctermfg=%d', kw, fg)
let s = printf('syn keyword %s %s', kw, kw)
call add(result, printf('%-32s | %s', h, s))
endfor
call writefile(result, a:outfile)
execute 'edit '.a:outfile
source %
endfunction
command! VimColorTest call VimColorTest('vim-color-test2.tmp', 255)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment