Closed alexherbo2 closed 5 years ago
Sorry, not sure what you mean by "grep file contents". There are currently two commands, one is sk-grep
that is bound to g in fzf-mode
and provides interactive grep over current directory recursive, and fzf-search
, which is bound to s in fzf-mode
and allows you to narrow through contents of current buffer but it is not grep
, it is pure fzf filtering.
sk-grep
is only available if skim is installed in your system.
Ah, maybe I get it.
Well, I've designed sk-grep
to be simple and work like fzf-search
does. We can make it use preview feature, and display line numbers, but it will require tweaking the implementation. It's not configurable right now.
It’s more about skim than fzf.kak, but the grep command is evaluated after each key-press? How about the performance.
Finally, I thought it might be interesting for sk-grep
to work with multiple selections, by populating the grep buffer, so search results are reusable with grep-next-match
and grep-previous-match
.
the grep command is evaluated after each key-press? How about the performance.
There is no other way to get new results, as all currently existing tools work this way. If there ever will be incremental grep program, it would be better in terms of performance, of course.
I thought it might be interesting for sk-grep to work with multiple selections, by populating the grep buffer, so search results are reusable with grep-next-match and grep-previous-match.
There are two points here:
grep
usage Kakoune provides useful command already.fzf
or skim
without something like tmux send-keys
, and fzf.kak supports X11 windows too, so I don't see a way to perform this.I was referring to the composability of both when selecting multiple elements with Tab and Shift + Tab from fzf: jump to the first match and populate the grep buffer, so that grep-next-match
and grep-previous-match
can cycle through the results.
It’s the same idea than doing a search with /, then be able to jump to the next occurrence with n and previous with Alt + n.
Hm, that's interesting idea. I'll implement this
How to grep file contents and get the file, line and column in results. And also the preview.