mirror of https://github.com/cheat/cheat.git
commit
c7f2576787
57
README.md
57
README.md
|
@ -10,8 +10,8 @@ remember.
|
||||||
`cheat` depends only on `python` and `pip`.
|
`cheat` depends only on `python` and `pip`.
|
||||||
|
|
||||||
|
|
||||||
Examples
|
Example
|
||||||
========
|
-------
|
||||||
The next time you're forced to disarm a nuclear weapon without consulting
|
The next time you're forced to disarm a nuclear weapon without consulting
|
||||||
Google, you may run:
|
Google, you may run:
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ Google, you may run:
|
||||||
|
|
||||||
You will be presented with a cheatsheet resembling:
|
You will be presented with a cheatsheet resembling:
|
||||||
|
|
||||||
```text
|
```
|
||||||
# To extract an uncompressed archive:
|
# To extract an uncompressed archive:
|
||||||
tar -xvf /path/to/foo.tar
|
tar -xvf /path/to/foo.tar
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ to store notes on your favorite cookie recipes, feel free.
|
||||||
|
|
||||||
|
|
||||||
Installing
|
Installing
|
||||||
==========
|
----------
|
||||||
First install the required python dependencies with:
|
First install the required python dependencies with:
|
||||||
|
|
||||||
sudo pip install docopt pygments
|
sudo pip install docopt pygments
|
||||||
|
@ -55,40 +55,38 @@ Then, clone this repository, `cd` into it, and run:
|
||||||
|
|
||||||
|
|
||||||
Modifying Cheatsheets
|
Modifying Cheatsheets
|
||||||
=====================
|
---------------------
|
||||||
The value of `cheat` is that it allows you to create your own cheatsheets - the
|
The value of `cheat` is that it allows you to create your own cheatsheets - the
|
||||||
defaults are meant to serve only as a starting point, and can and should be
|
defaults are meant to serve only as a starting point, and can and should be
|
||||||
modified.
|
modified.
|
||||||
|
|
||||||
Cheatsheets are stored in the `~/.cheat/` directory, and are named on a
|
Cheatsheets are stored in the `~/.cheat/` directory, and are named on a
|
||||||
per-keyphrase basis. In other words, the content for the `tar` cheatsheet lives
|
per-keyphrase basis. In other words, the content for the `tar` cheatsheet lives
|
||||||
in the `~/.cheat/tar` file. To add a cheatsheet for a `foo` command, you would
|
in the `~/.cheat/tar` file.
|
||||||
create file `~/.cheat/foo`, whereby that file contained the cheatsheet content.
|
|
||||||
|
|
||||||
Note that `cheat` supports "subcommands" simply by naming files appropriately.
|
Provided that you have an `EDITOR` environment variable set, you may edit
|
||||||
Thus, if you wanted to create a cheatsheet not only (for example) for `git` but
|
cheatsheets with:
|
||||||
also for `git commit`, you could do so be creating cheatsheet files of the
|
|
||||||
appropriate names (`git` and `git commit`).
|
cheat -e foo
|
||||||
|
|
||||||
|
If the 'foo' cheatsheet already exists, it will be opened for editing.
|
||||||
|
Otherwise, it will be created automatically.
|
||||||
|
|
||||||
After you've customized your cheatsheets, I urge you to track `~/.cheat/` along
|
After you've customized your cheatsheets, I urge you to track `~/.cheat/` along
|
||||||
with your [dotfiles][].
|
with your [dotfiles][].
|
||||||
|
|
||||||
|
|
||||||
Advanced Features
|
Configuring
|
||||||
=================
|
-----------
|
||||||
|
|
||||||
Setting a DEFAULT_CHEAT_DIR
|
### Setting a DEFAULT_CHEAT_DIR ###
|
||||||
---------------------------
|
|
||||||
Personal cheatsheets are saved in the `~/.cheat` directory by default, but you
|
Personal cheatsheets are saved in the `~/.cheat` directory by default, but you
|
||||||
can specify a different default by exporting a `DEFAULT_CHEAT_DIR` environment
|
can specify a different default by exporting a `DEFAULT_CHEAT_DIR` environment
|
||||||
variable:
|
variable:
|
||||||
|
|
||||||
```bash
|
|
||||||
export DEFAULT_CHEAT_DIR=/path/to/my/cheats
|
export DEFAULT_CHEAT_DIR=/path/to/my/cheats
|
||||||
```
|
|
||||||
|
|
||||||
Setting a CHEATPATH
|
### Setting a CHEATPATH ###
|
||||||
-------------------
|
|
||||||
You can additionally instruct `cheat` to look for cheatsheets in other
|
You can additionally instruct `cheat` to look for cheatsheets in other
|
||||||
directories by exporting a `CHEATPATH` environment variable:
|
directories by exporting a `CHEATPATH` environment variable:
|
||||||
|
|
||||||
|
@ -100,36 +98,21 @@ You may, of course, append multiple directories to your `CHEATPATH`:
|
||||||
|
|
||||||
You may view which directories are on your `CHEATPATH` with `cheat -d`.
|
You may view which directories are on your `CHEATPATH` with `cheat -d`.
|
||||||
|
|
||||||
Enabling Syntax Highlighting
|
### Enabling Syntax Highlighting ###
|
||||||
----------------------------
|
|
||||||
`cheat` can apply syntax highlighting to your cheatsheets if so desired. To
|
`cheat` can apply syntax highlighting to your cheatsheets if so desired. To
|
||||||
enable this feature, set a `CHEATCOLORS` environment variable:
|
enable this feature, set a `CHEATCOLORS` environment variable:
|
||||||
|
|
||||||
export CHEATCOLORS=true
|
export CHEATCOLORS=true
|
||||||
|
|
||||||
Creating/Editing Cheatsheets
|
|
||||||
----------------------------
|
|
||||||
Provided that you have an `EDITOR` environment variable set, you may create new
|
|
||||||
cheatsheets via:
|
|
||||||
|
|
||||||
cheat -e foo
|
|
||||||
|
|
||||||
If the 'foo' cheatsheet already exists, it will be opened for editing.
|
|
||||||
|
|
||||||
By default, `cheat` will attempt to write new cheatsheets to `~/.cheat`, and
|
|
||||||
will create the `~/.cheat` directory if necessary. If it is unable to do so,
|
|
||||||
the new cheatsheet will be written to the default cheatsheet directory instead,
|
|
||||||
though this will likely require `sudo`.
|
|
||||||
|
|
||||||
|
|
||||||
Contributing
|
Contributing
|
||||||
============
|
------------
|
||||||
If you would like to contribute cheetsheets or program functionality, please
|
If you would like to contribute cheetsheets or program functionality, please
|
||||||
fork this repository, make your changes, and send me a pull request.
|
fork this repository, make your changes, and send me a pull request.
|
||||||
|
|
||||||
|
|
||||||
Related Projects
|
Related Projects
|
||||||
================
|
----------------
|
||||||
|
|
||||||
- [lucaswerkmeister/cheats][1]: An implementation of this concept in pure bash
|
- [lucaswerkmeister/cheats][1]: An implementation of this concept in pure bash
|
||||||
that also allows not only for numerical indexing of subcomands but also
|
that also allows not only for numerical indexing of subcomands but also
|
||||||
|
|
Loading…
Reference in New Issue