diff --git a/README.md b/README.md index 735f681..66e812c 100644 --- a/README.md +++ b/README.md @@ -1,51 +1,70 @@ ![cheat.sh logo](http://cheat.sh/files/big-logo.png) +Unified read, search and write access to the popular cheat sheets repositories. + ## Features * simple curl/browser interface * available everywhere, no installation needed +* selected popular well maintained community driven cheat sheets repositories +* search (on a cheat sheet and in all cheat sheets) * tab completion -* search on a cheat sheet and in all cheat sheets * syntax highlighting -* uses community driven cheat sheets repositories +* editors integration + +## Usage + +To read a cheat sheet: + + curl cheat.sh/sudo + +Here `sudo` is the name of the cheat sheet you are looking for. + +If you don't know the name of the topic you need, +you can search for it using the ~KEYWORD notation. +For example, to see how you can make snapshots, you make the following query + + ~snapshot + +and get the list of snapshot creation examples commands. + +Programming languages cheat sheets are located in correspondent namespaces, +named after the name of the language: + + scala/Functions + +Read more about the programming languages cheat sheets below. + +There are several special pages, those name are always starting with a colon, +that are not cheat sheets and have special meaning. For example: + +``` + :help + :list list all cheat sheets + /perl/:list list all perl cheat sheets +``` + +cheat.sh supports tab completion in a shell and in a browser. +All major shells are supported. Read more on it in the *Tab completion* section. + +cheat.sh uses syntax highlighting by default. +You can switch it off, or choose other color scheme for it. +Use URL options for that. More on it in the *Options* section below. + Usage examples: ``` - $ curl cheat.sh/rsync - $ curl cheat.sh/btrfs~volume + $ curl cheat.sh/cpio $ curl cheat.sh/~snapshot - $ curl cheat.sh/scala/Functions - $ curl cheat.sh/scala/Functions~map + $ curl cheat.sh/go/range + $ curl cheat.sh/rust/hello + $ curl cheat.sh/rust/hello?T ``` ![cheat.sh usage](http://igor.chub.in/download/cheatsh-en.gif) -## Options - -``` - T omit terminal sequences (no colors; can be pasted in an editor) -``` - -## Special URLs - -Special URLs: - -``` - /:help # show help page - /:post # how to post new cheat sheets - /:list # list all known cheat sheets -``` - -## Tab completion - -``` - $ curl cheat.sh/:bash_completion > ~/.bash.d/cheat.sh - $ . ~/.bash.d/cheat.sh - $ # add . ~/.bash.d/cheat.sh to ~/.bashrc -``` - ## Search To search for a keyword, use the query: @@ -82,19 +101,106 @@ List of search options: r recursive search ``` +## Special URLs + +Special URLs: + +``` + :help this page + :list list all cheat sheets + :post how to post new cheat sheet + :bash_completion bash function for tab completion + :bash bash function and tab completion setup + :fish fish function and tab completion setup + :zsh zsh function and tab completion setup + :emacs cheat.sh function for emacs + :styles list of color styles + :styles-demo show color styles usage examples +``` + +## Tab completion + +Tab completion is a very important part of cheat.sh. +Having more than a thousand cheat sheets, it's very hard to learn all their names. + +If you use a cheat.sh shell functions, it's enough to include it +in `~/.bashrc`: + +``` + $ curl cheat.sh/:bash > ~/.bash.d/cheat.sh + $ . ~/.bash.d/cheat.sh + $ # add . ~/.bash.d/cheat.sh to ~/.bashrc +``` + +If you want to use cheat.sh with curl +and don't create any special functions, include `:bash_completion`: + +``` + $ curl cheat.sh/:bash_completion > ~/.bash.d/cheat.sh + $ . ~/.bash.d/cheat.sh + $ # add . ~/.bash.d/cheat.sh to ~/.bashrc +``` + +## Options + + ?OPTIONS + +``` + q quiet mode, don't show github/twitter buttons + T text only, no ANSI sequences (can be pasted in an editor) + style=STYLE color style +``` + +Options can be combined together in this way: + +``` + $ curl cheat.sh/for?qT\&style=bw +``` + +(note the `\` before `&`: it is escaping `&`, which has in shell special meaning). + +## Programming languages support + +Cheat sheets related to the programming languages +are organized in namespaces (subdirectories), that are named according +to the programming languages. + +For each supported programming languages +there are several special cheat sheets: it own sheet, `hello`, `:list` and `:learn`. +Say for lua it will look like: + +``` + lua + lua/hello + lua/:list + lua/:learn +``` +* `hello` describes how you can start with the language — install it if needed, build and run its programs, and it shows the "Hello world" program written in the language; +* `:list` shows all topics related to the language +* `:learn` shows a learn-x-in-minutes language cheat sheet perfect for getting started with the language. + ## Cheat sheets sources +Instead of creating yet another mediocre cheat sheet repository, +we are concentrating our efforts on creation of a unified +mechanism to access selected existing well developed and good maintained +cheat sheet repositories covering topics of our interest: +programming and operating systems usage. + cheat.sh uses several community driven repositories of cheat sheets: -* [cheat.sheets](https://github.com/chubin/cheat.sheets) [1 contributor][0 stars][May 1, 2017] +|Cheat sheets |Repository | Popularity | Creation Date | +|-----------------------|------------------------------------------------------|------------|---------------| +|UNIX/Linux, programming|[cheat.sheets](https://github.com/chubin/cheat.sheets)| 2/20 | May 1, 2017 | +|UNIX/Linux commands |[tldr-pages/tldr](https://github.com/tldr-pages/tldr) | 336/9449 | Dec 8, 2013 | +|UNIX/Linux commands |[chrisallenlane/cheat](https://github.com/chrisallenlane/cheat)|93/3231|Jul 28, 2013| +|Programming languages |[adambard/learnxinyminutes-docs](https://github.com/adambard/learnxinyminutes-docs)|999/4513|Jun 23, 2013| +|Go |[a8m/go-lang-cheat-sheet](https://github.com/a8m/go-lang-cheat-sheet)|23/2086|Feb 9, 2014| -External repositories: +Pie diagram reflecting cheat sheets sources distribution (by number of cheat sheets in repository): -* [tldr-pages/tldr](https://github.com/tldr-pages/tldr) [331 contributors][9.222 stars][Dec 8, 2013] -* [chrisallenlane/cheat](https://github.com/chrisallenlane/cheat) [93 contributors][3.144 stars][Jul 28, 2013] -* [a8m/go-lang-cheat-sheet](https://github.com/a8m/go-lang-cheat-sheet) [23 contributors][2.009 stars][Feb 9, 2014] -* [adambard/learnxinyminutes-docs](https://github.com/adambard/learnxinyminutes-docs) [985 contributors][4.405 stars][Jun 23, 2013] +![cheat.sh cheat sheets repositories](http://cheat.sh/files/stat-2017-06-05.png) ## How to add a cheat sheet