summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xrfv12
1 files changed, 12 insertions, 0 deletions
diff --git a/rfv b/rfv
new file mode 100755
index 0000000..23914a2
--- /dev/null
+++ b/rfv
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+
+# 1. Search for text in files using Ripgrep
+# 2. Interactively narrow down the list using fzf
+# 3. Open the file in Vim
+rg --color=always --line-number --no-heading --smart-case "${*:-}" |
+ fzf --ansi \
+ --color "hl:-1:underline,hl+:-1:underline:reverse" \
+ --delimiter : \
+ --preview 'bat --color=always {1} --highlight-line {2}' \
+ --preview-window 'up,60%,border-bottom,+{2}+3/3,~3' \
+ --bind 'enter:become(vim {1} +{2})'