I have been recently discovering the combination of fzf
and ripgrep
and it is working just fine.
ww(){
export BAT_THEME='gruvbox-dark'
RG_PREFIX="rg --column --line-number --no-heading --color=always --smart-case "
INITIAL_QUERY="${*:-}"
: | fzf --ansi --disabled --query "$INITIAL_QUERY"
--bind "start:reload:$RG_PREFIX {q}"
--bind "change:reload:sleep 0.1; $RG_PREFIX {q} || true"
--bind "alt-enter:unbind(change,alt-enter)+change-prompt(2. fzf> )+enable-search+clear-query"
--color "hl:-1:underline,hl+:-1:underline:reverse"
--prompt '1. ripgrep> '
--delimiter :
--preview 'bat --color=always {1} --highlight-line {2}'
--preview-window 'up,60%,border-bottom,+{2}+3/3,~3'
--bind 'enter:become(lvim {1} +{2})'
}
However, the use case for me is really to pass specific list of files that I put together based them into this function above ?
echo /path/to/file1 /another/path/file2 ... |
export BAT_THEME='gruvbox-dark'
RG_PREFIX="rg --column --line-number --no-heading --color=always --smart-case "
INITIAL_QUERY="${*:-}"
: | fzf --ansi --disabled --query "$INITIAL_QUERY"
--bind "start:reload:$RG_PREFIX {q}"
--bind "change:reload:sleep 0.1; $RG_PREFIX {q} || true"
--bind "alt-enter:unbind(change,alt-enter)+change-prompt(2. fzf> )+enable-search+clear-query"
--color "hl:-1:underline,hl+:-1:underline:reverse"
--prompt '1. ripgrep> '
--delimiter :
--preview 'bat --color=always {1} --highlight-line {2}'
--preview-window 'up,60%,border-bottom,+{2}+3/3,~3'
--bind 'enter:become(lvim {1} +{2})'
Any ideas ?