From 4685c6bd5a7afc598b1f130835253af42d496cfc Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Sat, 22 May 2021 16:25:04 -0400 Subject: add seek command --- seek | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 seek (limited to 'seek') diff --git a/seek b/seek new file mode 100755 index 0000000..ec489ac --- /dev/null +++ b/seek @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +RG_DEFAULT_COMMAND="rg --ignore-case --files-with-matches" +FZF_DEFAULT_COMMAND="rg --files" +selected=$(fzf \ + --multi \ + --exact \ + --ansi \ + --phony \ + --bind "ctrl-a:select-all" \ + --bind "change:reload:$RG_DEFAULT_COMMAND {q} || true" \ + --print-query \ + --preview "rg --ignore-case --pretty --context 2 {q} {}" +) +# returns 'query [files]' +edit +/$selected -- cgit v1.2.3