I implemented a fuzzy filter, which
- accept a list argument,
- open a window with a scratch buffer whose content set to the list, then
- waiting for use input and do filtering.
Here is why I ask this question, in the key loop, I want
- after
/
was type, go into a pass through mode, just like/
was typed in normal mode, thus subsquent keys will do search, and move cursor of the scratch window, sinceincsearch
was set, - after
<C-c>
or<C-m>
was typed, return back to previous key loop mode.
Is there any way to achieve above effect? I tried define a Handler for /
, which getchar()
then feedkeys()
after feedkeys('/')
, but seems caused infinite recursion/loop, which bumps cpu usage to 24%.
/
, you want tofeedkeys('/')
in order to search (so you probably did a mapping).feedkeys()
takes a flag to not use mappings... but you could also consider using whatever other programs like:FZF
orUnite
is using these days – D. Ben Knoble♦ Nov 12 '19 at 3:10sleep
might help with the cpu – Mass Nov 12 '19 at 3:51