From 8aeabd947338e85020fc274725dc098e35dcb09d Mon Sep 17 00:00:00 2001 From: Sanchayan Maity Date: Thu, 19 May 2022 09:39:28 +0530 Subject: [PATCH] fish: functions: Add fzf versions of vgrep --- fish/.config/fish/functions/vgF.fish | 4 ++++ fish/.config/fish/functions/vgf.fish | 4 ++++ 2 files changed, 8 insertions(+) create mode 100644 fish/.config/fish/functions/vgF.fish create mode 100644 fish/.config/fish/functions/vgf.fish diff --git a/fish/.config/fish/functions/vgF.fish b/fish/.config/fish/functions/vgF.fish new file mode 100644 index 0000000..4126410 --- /dev/null +++ b/fish/.config/fish/functions/vgF.fish @@ -0,0 +1,4 @@ +function vgF --wraps=vgrep --description 'vgrep search with fzf' + set -f INITIAL_QUERY $argv[1] + FZF_DEFAULT_COMMAND="vgrep --no-header $INITIAL_QUERY" fzf --bind "Ctrl-d:half-page-down,Ctrl-u:half-page-up,change:reload:vgrep --no-header {q} || true" --ansi --phony --tac --query $INITIAL_QUERY | awk '{print $1}' | xargs -I{} -o vgrep --show {} +end diff --git a/fish/.config/fish/functions/vgf.fish b/fish/.config/fish/functions/vgf.fish new file mode 100644 index 0000000..452b498 --- /dev/null +++ b/fish/.config/fish/functions/vgf.fish @@ -0,0 +1,4 @@ +function vgf --wraps=vgrep --description 'vgrep search with fzf' + set -f INITIAL_QUERY $argv[1] + vgrep --no-header $INITIAL_QUERY | fzf --ansi --bind "Ctrl-d:half-page-down,Ctrl-u:half-page-up" | awk '{print $1}' | xargs -I{} -o vgrep --show {} +end