the script should be the final argument to jfind
for e.g:
ps aux | tail +2 | jfind 'interval(1, refresh)'
this would allow for easier customisation. for example there could be a lua function which highlights a line in the preview. this would make live grep work without the nasty --preview-line flag.
jfind '
command("rg -n")
map(ctrl_r, refresh)
onItemChange(function(item)
file, line = item:match("(.*):(.*):")
preview("cat", file)
highlightPreviewLine(line)
end)'
and then while doing live grep you could enter fuzzy matching mode with the grepped results
jfind '
local cmd = "rg -n"
command(cmd)
map(ctrl_r, refresh)
onItemChange(function(item)
file, line = item:match("(.*):(.*):")
preview("cat", file)
highlightPreviewLine(line)
end)
local fuzzyMode = false
map(ctrl_f, function()
if fuzzyMode then
useMatcher(FUZZY)
else
command(cmd)
end
fuzzyMode = ~fuzzyMode
end)'
the script should be the final argument to jfind
for e.g:
this would allow for easier customisation. for example there could be a lua function which highlights a line in the preview. this would make live grep work without the nasty
--preview-lineflag.and then while doing live grep you could enter fuzzy matching mode with the grepped results