From c40bd7ce82d5a9fb83833bbb8c3385c9953ad2fb Mon Sep 17 00:00:00 2001 From: Ronan Jouchet Date: Sat, 8 Jan 2022 14:43:36 -0500 Subject: [PATCH] kittens/hyperlinked_grep: document how to tell fish to autocomplete with rg It was documented for zsh but not fish (2 lines above). While looking for how to do the same in fish, I couldn't find how to do *exactly the same*, but turns out there's a neat way to do both the aliasing and autocompletion mapping at the same time. See https://fishshell.com/docs/current/cmds/function.html : > `-w WRAPPED_COMMAND` or `--wraps=WRAPPED_COMMAND` causes the function > to inherit completions from the given wrapped command. See the > documentation for [complete](https://fishshell.com/docs/current/cmds/complete.html#cmd-complete) > for more information. --- docs/kittens/hyperlinked_grep.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/kittens/hyperlinked_grep.rst b/docs/kittens/hyperlinked_grep.rst index cb60e4893..10a010dcf 100644 --- a/docs/kittens/hyperlinked_grep.rst +++ b/docs/kittens/hyperlinked_grep.rst @@ -57,6 +57,11 @@ Then, for example, for ZSH, add the following to :file:`.zshrc`:: compdef _rg hg +Note to fish users: you can combine both the aliasing/wrapping and pointing fish +to rg's autocompletion with a fish "wrapper" function in your :file:`config.fish`:: + + function hg --wraps rg; kitty +kitten hyperlinked_grep $argv; end + To learn more about kitty's powerful framework for customizing URL click actions, :doc:`see here `.