From 93535db0de28f3dc403b0d1f21fc81e1e48c1617 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Fri, 29 Jan 2016 01:34:15 +0900 Subject: [PATCH] Updated Examples (completion) (markdown) --- Examples-(completion).md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Examples-(completion).md b/Examples-(completion).md index 0346e8b..908a18a 100644 --- a/Examples-(completion).md +++ b/Examples-(completion).md @@ -29,6 +29,24 @@ zsh will automatically pick up the command using the naming convention but in ba [ -n "$BASH" ] && complete -F _fzf_complete_doge -o default -o bashdefault doge ``` +### Post-processing + +If you need to post-process the output from fzf, define `_fzf_complete_COMMAND_post` as follows. + +```sh +_fzf_complete_foo() { + _fzf_complete "--multi --reverse --header-lines=3" "$@" < <( + ls -al + ) +} + +_fzf_complete_foo_post() { + awk '{print $NF}' +} + +[ -n "$BASH" ] && complete -F _fzf_complete_foo -o default -o bashdefault foo +``` + Examples --------