From b697e7a84e51fa1fa234be8898df15b1370fccec Mon Sep 17 00:00:00 2001 From: Anton Bobov Date: Fri, 20 Sep 2024 00:33:21 +0500 Subject: Add ripgrep interactive search using fzf --- rfv | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 rfv 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})' -- cgit v1.2.3