Skip to content

Instantly share code, notes, and snippets.

View nuclight's full-sized avatar

Vadim Goncharov nuclight

  • Moscow
View GitHub Profile
@Vftdan
Vftdan / catcolored.vim
Last active August 7, 2021 18:27
NeoVim script to pretty print the file to terminal
function! s:color_to_ansi(cstr, is_bg)
let l:car=a:is_bg ? 40 : 30
let l:cdr=[]
if a:cstr[0] == '#'
let l:car+=8
let l:cdr=[2] + map(split(a:cstr[1:], '\v..\zs'), 'str2nr(v:val, 16)')
elseif a:cstr > 15
let l:car+=8
let l:cdr=[5, a:cstr]
else