summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2021-05-22 16:25:04 -0400
committerBen Sima <ben@bsima.me>2021-05-22 16:25:04 -0400
commit4685c6bd5a7afc598b1f130835253af42d496cfc (patch)
tree38f5e6798a0f5d79611402a73bb8132096533f54
parent57b6271251f343b49351883090a3b1955ba0ddae (diff)
add seek command
-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