diff options
| author | Anton Bobov <anton@bobov.name> | 2024-09-20 00:33:21 +0500 |
|---|---|---|
| committer | Anton Bobov <anton@bobov.name> | 2024-09-20 00:34:19 +0500 |
| commit | b697e7a84e51fa1fa234be8898df15b1370fccec (patch) | |
| tree | b08cd26fdd0ee8a36c545f69ab31264df6a52536 | |
| parent | 429916071ca0b59dc221cfd68fe80207e0e4f2d8 (diff) | |
Add ripgrep interactive search using fzf
| -rwxr-xr-x | rfv | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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})' |
