FollieHiyuki-dotfiles/home/.local/bin/fzf/fzrg
2021-02-13 19:28:59 +03:00

15 lines
309 B
Bash
Executable File

#!/bin/sh
choice=$(rg --color=always -n "$1" 2> /dev/null |
fzf -d: \
--ansi \
--query="$1" \
--disabled \
--no-multi \
--preview='bat --color=always --style=header,numbers -H {2} {1} | grep -C3 {q}')
line=$(echo "$choice" | cut -d':' -f2)
file=$(echo "$choice" | cut -d':' -f1)
nvim +"$line" "$PWD/$file"