Iex history fuzzy find

Hello,

I wanted to share you some a little script I made to search my iex history.
It require tmux and fzf.

How it look like (click if the gif is not playing)
demo

If you are interested or have some suggestions you can check the github repo

12 Likes

As my iex history is now over 1400 lines. I realized I forgot to implement a part to read all the history.

Can this be used without tmux? I am interested in having better history search but I’d prefer such a tool to be mostly independent of the shell it’s used in.

1 Like

It will be nice but I don’t know if it’s possible, last time I checked . Let me explain you how I did.
I open another shell in a split below with tmux then I run fzf in this terminal with my elixir history as input the output (selected line) is written in a fifo. The fifo is read and the line is send as key to the shell running iex.

mkfifo -m o+w $fifo

tmux split-window "iex-history | fzf -s > $fifo"
tmux send-keys -t $current_pane -l "$(cat $fifo)"
2 Likes

If terminal supports split windows and sending input to a window - same can be replicated in any terminal emulator/multiplexer.

@dimitarvp what terminal emulator / terminal multiplexer do you use?

I use iTerm2 and Alacritty, soon a few others on Linux will follow. I don’t use multiplexers.

1 Like

Thanks to @dimitarvp who bumped my thread I revisited the project today.
One thing that annoy me is when I typed many line in iex pressing arrow up only show the last line.
I added the fzf option to select multiples lines.
Check the new demo on asciinema :slight_smile:
asciicast

2 Likes