[ANN?] Fzf (fuzzy search) for REPL history

By wrapping the fzf (fzf_jll and JLFzf) (I realize it should probably just be called Fzf.jl but name is then too short (since potentially one can make a julia implementation of Fzf)

now one can have a cool fuzzy search experience, demo: https://streamable.com/jxdjx9

by adding this to startup.jl: https://gist.github.com/Moelf/d1f366b4005f71edc80b24dc43ef1857 , (triggered by Ctrl-f)

the eventual goal is to add this to OhMyREPL


awesome. I am already addicted to fzf + fish.

1 Like

Ctrl-f is already used for forward one character (as in emacs). I install your package and the gist, and find that Ctrl-f still does forward one character rather than fuzzy history search. Am I missing something?

(btw. I have successfully ignored config chores in favor of work today, but was unable to resist here.)

ah, you can just change ^f in startup.jl to something else then

I see. I looks like I have to choose something that is not already bound. In my case ^q works. But, I’m using default keybindings (linux, if that matters). fzf errors out complaining that the list (my repl history) is too long (190K lines). If I delete repl_history.jl then your package + init code do work !

1 Like

oh interesting, I didn’t know fzf would complain, ehh, so you can probably hack the call in startup.jl to take the last 10k lines maybe

FYI, here is another setup for using fzf with https://github.com/tkf/InteractiveCodeSearch.jl

using InteractiveCodeSearch
InteractiveCodeSearch.CONFIG.interactive_matcher = `fzf`
@search show             # search method definitions of show
@searchmethods 1         # search methods defined for integer
@searchhistory           # search history

If you have pygmentize, you can have multi-line preview with syntax highlighting:

InteractiveCodeSearch.CONFIG.interactive_matcher = `fzf --preview 'echo {} | sed "s/⏎/\n/g" | pygmentize -l jl'`