From d8ce64593a5e45d0ac4432fc64ad81cf648dca71 Mon Sep 17 00:00:00 2001 From: Jonathan Roy Date: Tue, 28 Nov 2017 16:47:08 -0500 Subject: [PATCH] Add missing file for zsh completion --- share/zsh.txt | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 share/zsh.txt diff --git a/share/zsh.txt b/share/zsh.txt new file mode 100644 index 0000000..12f4fad --- /dev/null +++ b/share/zsh.txt @@ -0,0 +1,27 @@ +# add this to ~/.zshrc or any other place that will be sourced by your .dotfiles script + +cheat.sh() +{ + # replace native with the color scheme you want + # curl cheat.sh/:styles-demo to show the available color schemes + curl -s cheat.sh/"$1"?style=native +} + +_cheatsh_complete_cheatsh() +{ + local cur opts #prev + _get_comp_words_by_ref -n : cur + + COMPREPLY=() + prev="${COMP_WORDS[COMP_CWORD-1]}" + opts="$(curl -s cheat.sh/:list)" + + #if [[ "${cur}" == ch ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + __ltrim_colon_completions "$cur" + return 0 + #fi +} + +compdef _cheatsh_complete_cheatsh cheat.sh +