summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xseek15
1 files changed, 15 insertions, 0 deletions
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