Skip to content

Commit 5e9cbda

Browse files
committed
Rearrange docs
1 parent 17f1593 commit 5e9cbda

File tree

4 files changed

+157
-214
lines changed

4 files changed

+157
-214
lines changed

README.md

Lines changed: 57 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -33,28 +33,29 @@ example with some of the included plugins you can select from:
3333
- [Systemd](https://systemd.io/) units
3434
- [Tmux](https://github.com/tmux/tmux) components
3535
- Internet [RFCs](https://www.rfc-editor.org/)
36+
- [Magic: The Gathering](https://scryfall.com/) cards
3637

3738
## Tools
3839

39-
The following line selection tools are
40-
supported:
41-
42-
| Tool | Mode | Rating |
43-
| ---------------------------------------------------------- | ---- | ------ |
44-
| [choose](https://github.com/chipsenkbeil/choose) | GUI | 🍎 |
45-
| [dmenu](https://tools.suckless.org/dmenu) | GUI | 😎 |
46-
| [fzf](https://github.com/junegunn/fzf) | TTY | 😸 |
47-
| [fzy](https://github.com/jhawthorn/fzy) | TTY | 😺 |
48-
| [gum](https://github.com/charmbracelet/gum) | TTY | 🤩 |
49-
| [iselect](http://www.ossp.org/pkg/tool/iselect) | TTY | 😏 |
50-
| [pick](https://github.com/mptre/pick) | TTY | 😃 |
51-
| [pipedial](https://code.reversed.top/user/xaizek/pipedial) | TTY | 😒 |
52-
| [rofi](https://github.com/davatorium/rofi) | GUI | 😄 |
53-
| [selecta](https://github.com/garybernhardt/selecta) | TTY | 😉 |
54-
| [sentaku](https://github.com/rcmdnk/sentaku) | TTY | 🙄 |
55-
| [slmenu](https://github.com/joshaw/slmenu) | TTY | 😞 |
56-
| [vis-menu](https://github.com/martanne/vis) | TTY | 😢 |
57-
| [zenity](https://wiki.gnome.org/Projects/Zenity) | GUI | 🤮 |
40+
The following line selection tools are supported:
41+
42+
| Tool | Mode |
43+
| ---------------------------------------------------------- | ---- |
44+
| [choose](https://github.com/chipsenkbeil/choose) | GUI |
45+
| [dmenu](https://tools.suckless.org/dmenu) | GUI |
46+
| [fzf](https://github.com/junegunn/fzf) | TTY |
47+
| [fzy](https://github.com/jhawthorn/fzy) | TTY |
48+
| [gum](https://github.com/charmbracelet/gum) | TTY |
49+
| [iselect](http://www.ossp.org/pkg/tool/iselect) | TTY |
50+
| [pick](https://github.com/mptre/pick) | TTY |
51+
| [pipedial](https://code.reversed.top/user/xaizek/pipedial) | TTY |
52+
| [rofi](https://github.com/davatorium/rofi) | GUI |
53+
| [selecta](https://github.com/garybernhardt/selecta) | TTY |
54+
| [sentaku](https://github.com/rcmdnk/sentaku) | TTY |
55+
| [skim](https://github.com/lotabout/skim) | TTY |
56+
| [slmenu](https://github.com/joshaw/slmenu) | TTY |
57+
| [vis-menu](https://github.com/martanne/vis) | TTY |
58+
| [zenity](https://wiki.gnome.org/Projects/Zenity) | GUI |
5859

5960
Many thanks to the authors of the above tools\!
6061

@@ -64,7 +65,7 @@ Aware of any other line selection tools? Let me know.
6465

6566
``` bash
6667
# just download the script to a directory on your path
67-
curl https://raw.githubusercontent.com/apathor/cz/master/cz -o ~/bin/cz
68+
curl -sS https://raw.githubusercontent.com/apathor/cz/master/bin/cz -o ~/bin/cz
6869

6970
# and make it executable
7071
chmod -v +x ~/bin/cz
@@ -163,7 +164,7 @@ your bashrc file.
163164
The example config defines key bindings that run cz to provide
164165
interactive functionality.
165166

166-
Some of the key bindings use the included function \`reval\` to do one
167+
Some of the key bindings use the included function \`rleval\` to do one
167168
of the following:
168169

169170
- Insert output from cz into the bash command buffer at cursor point.
@@ -172,36 +173,26 @@ of the following:
172173
- Run cz to launch an interactive program (like $EDITOR) using some
173174
part of the selection.
174175

175-
The example key bindings are as follows:
176-
177-
- C-x x : Select a cz plugin, run it in quote mode, and insert one or
178-
more fields from the selection.
179-
- C-x X : Select a cz plugin, run it print mode, and insert the
180-
selection.
181-
- C-x z : Select a cz plugin, run it in run mode, and insert the
182-
output of the command.
183-
- C-x Z : Select a cz plguin, run it in simulate mode and insert the
184-
command templated with the selection.
185-
- C-x r : Select a command from bash history and insert it.
186-
- C-x u : Select a unicode character and insert it.
187-
- C-x g : Select an uncomitted file in current git repository and
188-
insert its path.
189-
- C-x G : Select a comitted file in current git repository and insert
190-
its path.
191-
- C-x d : Using the current word as a directory, replace it with a
192-
selected descendant directory.
193-
- C-x D : Using the current word as a pattern, replace it with a
194-
selected matching descendant directory under $PWD.
195-
- C-x f : Using the current word as a directory, replace it with a
196-
selected descendant file.
197-
- C-x F : Using the current word as a pattern, replace it with a
198-
selected matching descendant file under $PWD.
199-
- C-x l : Using the current word as a pattern, replace it with a
200-
selected matching file from the locate database.
201-
- C-x e : Using the current word as a pattern, replace it with the
202-
path of a file matching it under $PWD.
203-
- C-x E : Using the current word as a pattern, run $EDITOR to open
204-
selected file matching it under $PWD.
176+
The example key bindings are as
177+
follows:
178+
179+
| Keys | Function |
180+
| ----- | --------------------------------------------------------------------------------------------------------- |
181+
| C-x x | Select a cz plugin, run it in quote mode, and insert one or more fields from the selection. |
182+
| C-x X | Select a cz plugin, run it print mode, and insert the selection. |
183+
| C-x z | Select a cz plugin, run it in run mode, and insert the output of the command. |
184+
| C-x Z | Select a cz plguin, run it in simulate mode and insert the command templated with the selection. |
185+
| C-x r | Select a command from bash history and insert it. |
186+
| C-x u | Select a unicode character and insert it. |
187+
| C-x g | Select an uncomitted file in current git repository and insert its path. |
188+
| C-x G | Select a comitted file in current git repository and insert its path. |
189+
| C-x d | Using the current word as a directory, replace it with a selected descendant directory. |
190+
| C-x D | Using the current word as a pattern, replace it with a selected matching descendant directory under $PWD. |
191+
| C-x f | Using the current word as a directory, replace it with a selected descendant file. |
192+
| C-x F | Using the current word as a pattern, replace it with a selected matching descendant file under $PWD. |
193+
| C-x l | Using the current word as a pattern, replace it with a selected matching file from the locate database. |
194+
| C-x e | Using the current word as a pattern, replace it with the path of a file matching it under $PWD. |
195+
| C-x E | Using the current word as a pattern, run $EDITOR to open selected file matching it under $PWD. |
205196

206197
### Zsh
207198

@@ -214,75 +205,21 @@ section above.
214205

215206
Download the example i3 config then copy it into your i3 config.
216207

217-
The example config defines the following key bindings:
218-
219-
- Mod-x : Select a cz plugin, run it, and put fields from selected
220-
line into a clipboard.
221-
- Mod-X : Select a cz plugin, run it, and put selected line into a
222-
clipboard.
223-
- Mod-z : Select a cz plugin, run it, and put the command output into
224-
a clipboard.
225-
- Mod-Z : Select a cz plguin, run it in simulate mode, and put the
226-
output into a clipboard.
227-
- Mod-c : Select a command and run it.
228-
- Mod-C : Select a clipboard and pipe its contents through the
229-
selected command.
230-
- Mod-o : Select a clipboard then select a URL extracted from its
231-
contents to open in a browser.
232-
- Mod-Shift-Space : Select an i3 a tag and jump to the selected
233-
window.
234-
- Mod-Tab : Select an i3 window and jump to it.
235-
- Mod-Shift-Tab : Select an i3 workspace and switch to it.
236-
237-
## Plugins
238-
239-
Cz considers any command starting with 'cz\_' a valid plugin.
240-
241-
Plugins must:
242-
243-
- Print usage text if the CZ\_HELP environment variable is non-empty.
244-
- Provide some application specific input to cz.
245-
- Run cz with application specific options (-d, -e, -f, -i) but
246-
without setting any of the mode options (-p, -q, -r, -s, -t, -u).
247-
248-
### Example - bash function
249-
250-
A function like the following could be defined in your bash
251-
configuration:
252-
253-
``` bash
254-
cz_fruit() {
255-
if [ -n "$CZ_HELP" ]; then
256-
printf "cz fruit\nSelect a fruit\n" >&2
257-
return 0
258-
fi
259-
cz -e 'printf "Go %s!\n" {0}' \
260-
-i <(printf "%s\n" apple banana grapefruit orange)
261-
}
262-
263-
```
264-
265-
### Example - external program
266-
267-
Use your favorite language\! Here is an example plugin that lets you
268-
select from powers of two.
269-
270-
Put the following in an executable file called 'cz\_twos' on your path:
271-
272-
``` perl
273-
#!/usr/bin/env perl
274-
use strict;
275-
use warnings;
276-
277-
if($ENV{"CZ_HELP"}) {
278-
print STDERR "cz twos\nSelect from powers of two.\n";
279-
exit 0;
280-
}
281-
282-
open(my $pipe, "|-", "cz -f 1");
283-
print $pipe $_ for map { sprintf "%d %d\n", $_, 2 ** $_ } (1..32);
284-
close($pipe);
285-
```
208+
The example config defines the following key
209+
bindings:
210+
211+
| Keys | Function |
212+
| --------------- | -------------------------------------------------------------------------------------- |
213+
| Mod x | Select a cz plugin, run it, and put fields from selected line into a clipboard. |
214+
| Mod X | Select a cz plugin, run it, and put selected line into a clipboard. |
215+
| Mod z | Select a cz plugin, run it, and put the command output into a clipboard. |
216+
| Mod Z | Select a cz plguin, run it in simulate mode, and put the output into a clipboard. |
217+
| Mod c | Select a command and run it. |
218+
| Mod C | Select a clipboard and pipe its contents through the selected command. |
219+
| Mod o | Select a clipboard then select a URL extracted from its contents to open in a browser. |
220+
| Mod Shift Space | Select an i3 a tag and jump to the selected window. |
221+
| Mod Tab | Select an i3 window and jump to it. |
222+
| Mod Shift Tab | Select an i3 workspace and switch to it. |
286223

287224
## Name
288225

0 commit comments

Comments
 (0)