blob: ec489ac20c7d72d4e9e2c08454a21933695d79ca (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
#!/usr/bin/env bash
RG_DEFAULT_COMMAND="rg --ignore-case --files-with-matches"
FZF_DEFAULT_COMMAND="rg --files"
selected=$(fzf \
--multi \
--exact \
--ansi \
--phony \
--bind "ctrl-a:select-all" \
--bind "change:reload:$RG_DEFAULT_COMMAND {q} || true" \
--print-query \
--preview "rg --ignore-case --pretty --context 2 {q} {}"
)
# returns 'query [files]'
edit +/$selected
|