how to integrate ripgrep with fzf by using match positions? #2580
-
I have this function that does live grep. function rgf() {
c="rg --column -nS --no-heading --color=always"
f="$(cmd="$c ''" fzf --bind "change:reload:$c {q} || true" \
--ansi --layout=reverse --preview '' --header 'Search in files' \
| cut -d':' -f1 | sed 's/\\/\\\\/g;s/"/\\"/g'
)"
if [[ -n $f ]]; then
$EDITOR $f
cd $(dirname $(readlink -f "$f"))
fi
} Is there a way to get the line number for the selected file so i can |
Beta Was this translation helpful? Give feedback.
Answered by
joelpeapen
Aug 14, 2023
Replies: 1 comment 5 replies
-
This looks like an fzf question or a general shell scripting question. The |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
found it. maybe this could be in a tips section.