Giter Site home page Giter Site logo

ccat's Introduction

ccat

OpenCollective OpenCollective

ccat is the colorizing cat. It works similar to cat but displays content with syntax highlighting.

Supported Languages

  • JavaScript
  • Java
  • Ruby
  • Python
  • Go
  • C

Installation

OSX

$ brew install ccat

Arch Linux

$ pacaur -S ccat
$ pacaur -S ccat-git

The ccat package will reflect the current release snapshot, while the ccat-git will be based on the current source available in the master branch of the git repo. You can use any AUR helper in place of pacaur AUR Helpers

Standalone

ccat can be easily installed as an executable. Download the latest compiled binaries and put it in your executable path.

From source

Prerequisites:

$ go get -u github.com/jingweno/ccat

Usage

$ ccat FILE1 FILE2 ...
$ ccat FILE1 FILE2 ... --html # output in HTML
$ ccat --bg=dark FILE1 FILE 2 ... # dark background
$ ccat -G String="_darkblue_" -G Plaintext="darkred" FILE # set color codes
$ ccat --palette # show palette
$ ccat # read from standard input
$ curl https://raw.githubusercontent.com/jingweno/ccat/master/main.go | ccat

It's recommended to alias ccat to cat:

alias cat=ccat

The overhead of ccat comparing to cat is mimimum:

$ wc -l main.go
123 main.go
$ time cat main.go > /dev/null
cat main.go > /dev/null  0.00s user 0.00s system 61% cpu 0.005 total
$ time ccat main.go > /dev/null
ccat main.go > /dev/null  0.00s user 0.00s system 78% cpu 0.007 total

You can always invoke cat after aliasing ccat by typing \cat.

Demo

demo

Roadmap

  • nicer default color scheme
  • ?

Alternatives

ccat is designed to be distributed in one binary, run at native speed and follow the POSIX standards. There're alternatives out there. Use them at your own risk :):

License

MIT

Credits

Thanks to Sourcegraph who built this awesome syntax-highlighting package.

Support

Backers

Support us with a monthly donation and help us continue our activities. [Become a backer]

Sponsors

Become a sponsor and get your logo on our README on Github with a link to your site. [Become a sponsor]

ccat's People

Contributors

178inaba avatar dmitshur avatar forivall avatar gilliek avatar iand avatar ladydascalie avatar mathhun avatar mattn avatar owenthereal avatar piamancini avatar vitorgalvao avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.