|bcat

pipe to browser utility

README, INSTALLING, COPYING, CONTRIBUTING

Manuals

bcat(1), btee(1)
browser cat and browser tee.
a2h(1)
VT100/ANSI escape sequence to HTML converter.

Examples

With build tools:

make test |bcat
rake test |bcat

As a clipboard viewer:

pbpaste  |bcat   # macos
xclip -o |bcat   # X11

For previewing HTML:

markdown README.md |bcat
redcloth README.textile |bcat
erb -T - template.erb |bcat
mustache < template.mustache |bcat
pygmentize -Ofull,style=colorful -f html main.c |bcat

As a simple man pager:

export MANPAGER='col -b |bcat'
man grep

With git, selectively:

git log -p --color |bcat
git diff --color HEAD@{5d} HEAD |bcat

With git, as the default PAGER:

export GIT_PAGER=bcat
git log -p
git diff HEAD@{5d} HEAD

As a log viewer:

tail -n 1000 -f /var/log/messages |bcat
tail -f $RAILS_ROOT/log/development.log |bcat

Or, a remote log viewer:

ssh example.org 'tail -n 1000 -f /var/log/syslog' |bcat

Vim and vi Examples

Preview current buffer as HTML:

:!markdown % |bcat
:!ronn -5 --pipe % |bcat

Create keymappings:

:map ,pm :!markdown % \|bcat
:map ,pp :!pygmentize -Ofull,style=colorful -f html % \|bcat

Use with makeprg:

:set makeprg=make\ \\\|bcat
:set makeprg=markdown\ %\ \\\|bcat
:set makeprg=testrb\ %\ \\\|bcat

See Also

Copyright © 2010 Ryan Tomayko