Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to have some program's output colorized as it apperas on terminal.

I know that utility named highlight does the this. But: it has a limited set of built-in language support, and I want coloring for e.g. some work-related daemon logs, for which I already made complex vim syntax files.

I know it is possible to use vim for syntax highlighting as less replacement (vimpager) or directly in terminal (vimcat). But, both these ways vim waits until EOF, and then display colored file -- it's useless for e.g. live daemon testing.

So: is it possible to use vim's syntax highlighting in "live mode"? Or maybe is there an automatic converter from vim's syntax files to highlight's language definitions?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

maybe this (http://www.vim.org/scripts/script.php?script%5Fid=1714) could be a solution for you

use vim like tail

share|improve this answer
    
it's not perfect, but it may do the thing after a bit of tweaking (getting rid of vim's window as in vimcat, shortening updatetime for this mode). Thanks. –  user1815209 Nov 15 '13 at 19:02
    
found another thread about this superuser.com/questions/117841/get-colors-in-less-command maybe you find something better there –  konqui Nov 24 '13 at 12:16
    
pygmentize is nice, but there's the same issue as with highlight -- i'd have to write my own syntax file. Since there was no way to simply use my vim syntax file, I ended up writing a bash script with a bunch of sed-ing imitating most important aspects of the mentioned vim syntax file to color piped output from my programs. –  user1815209 Nov 27 '13 at 12:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.