From c9840c2d6f7016941c83083692a1273411f8ce45 Mon Sep 17 00:00:00 2001 From: Chris Lane Date: Tue, 7 Apr 2020 18:47:35 -0400 Subject: [PATCH] docs(autocompletion): update autocompletion docs Update the autocompletion documentation (in `README` and `man` page) to include information about configuring `zsh` autocompletion script. --- README.md | 11 +++++------ doc/cheat.1 | 16 ++++++++++++---- doc/cheat.1.md | 11 ++++++++--- 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 6aac381..b40146a 100644 --- a/README.md +++ b/README.md @@ -196,14 +196,13 @@ cheat -p personal -t networking --regex -s '(?:[0-9]{1,3}\.){3}[0-9]{1,3}' Advanced Usage -------------- -Shell autocompletion is currently available for the `bash` and `fish` shells. -Copy the relevant [completion script][completions] into the appropriate -directory on your filesystem to enable autocompletion. (This directory will -vary depending on operating system and shell specifics.) +Shell autocompletion is currently available for `bash`, `fish`, and `zsh`. Copy +the relevant [completion script][completions] into the appropriate directory on +your filesystem to enable autocompletion. (This directory will vary depending +on operating system and shell specifics.) Additionally, `cheat` supports enhanced autocompletion via integration with -[fzf][]. (This feature is currently available on bash only.) To enable `fzf` -integration: +[fzf][]. To enable `fzf` integration: 1. Ensure that `fzf` is available on your `$PATH` 2. Set an envvar: `export CHEAT_USE_FZF=true` diff --git a/doc/cheat.1 b/doc/cheat.1 index 41bd437..5b2c932 100644 --- a/doc/cheat.1 +++ b/doc/cheat.1 @@ -175,15 +175,17 @@ For detailed instructions on how to configure cheatpaths, please refer to the comments in conf.yml. .SS Autocompletion .PP -Autocompletion scripts for \f[B]bash\f[]/\f[B]zsh\f[] and \f[B]fish\f[] -are available for download: +Autocompletion scripts for \f[B]bash\f[], \f[B]zsh\f[], and +\f[B]fish\f[] are available for download: .IP \[bu] 2 .IP \[bu] 2 +.IP \[bu] 2 + .PP -The \f[B]bash\f[]/\f[B]zsh\f[] scripts provide optional integration with -\f[B]fzf\f[], if the latter is available on your \f[B]PATH\f[]. +The \f[B]bash\f[] and \f[B]zsh\f[] scripts provide optional integration +with \f[B]fzf\f[], if the latter is available on your \f[B]PATH\f[]. .PP The installation process will vary per system and shell configuration, and thus will not be discussed here. @@ -195,6 +197,12 @@ If \f[B]CHEAT_CONFIG_PATH\f[] is set, all other config paths will be ignored. .RS .RE +.TP +.B \f[B]CHEAT_USE_FZF\f[] +If set, autocompletion scripts will attempt to integrate with +\f[B]fzf\f[]. +.RS +.RE .SH BUGS .PP See GitHub issues: diff --git a/doc/cheat.1.md b/doc/cheat.1.md index 1fa69bc..f587195 100644 --- a/doc/cheat.1.md +++ b/doc/cheat.1.md @@ -137,14 +137,15 @@ comments in conf.yml. Autocompletion -------------- -Autocompletion scripts for **bash**/**zsh** and **fish** are available for +Autocompletion scripts for **bash**, **zsh**, and **fish** are available for download: - - +- -The **bash**/**zsh** scripts provide optional integration with **fzf**, if the -latter is available on your **PATH**. +The **bash** and **zsh** scripts provide optional integration with **fzf**, if +the latter is available on your **PATH**. The installation process will vary per system and shell configuration, and thus will not be discussed here. @@ -158,6 +159,10 @@ ENVIRONMENT : The path at which the config file is available. If **CHEAT_CONFIG_PATH** is set, all other config paths will be ignored. +**CHEAT_USE_FZF** + +: If set, autocompletion scripts will attempt to integrate with **fzf**. + BUGS ====