OhMyREPL.jl
OhMyREPL.jl copied to clipboard
Exctract history to clipboard/a script file
Hello,
There's some minor functionality I've been wanting, and I'm not sure if it would be good as an addition to OhMyREPL or if I should just make a small package for it.
Often I find myself playing with something in the REPL, and then wanting to extract a few lines say to a function I'm writing, or as a script file.
FZF has the -m
flag which lets you select multiple candidates with TAB
. I'd like to use this to be able to easily grab bits of the history, and either
- copy to clipboard, or
- save to a file
With JLFzf
, this is as simple as JLFzf.inter_fzf(JLFzf.read_repl_hist(), "-m", "--tiebreak=index", "--read0") |> clipboard
, but I feel something more people than just me might find useful.
What do you think?
I actually need this lol, right now I restart REPL and use up arrow to run correct commands in the correct order and take a screen shot
Actually, I don't see why history completion couldn't use this so you can fill multiple lines in from history at once. All it takes is adding the -m
flag.
- https://github.com/KristofferC/OhMyREPL.jl/pull/256
I also like it has the flexibility that you can re-order lines by marking them out of order
I tried https://github.com/KristofferC/OhMyREPL.jl/pull/256#issuecomment-1031210203 but it didn't work for me.
For the original request wanting to pick specific bits of REPL history and copying them to the clipboard, there's pickandcopy()
from DoctorDocstrings.jl. (Seems to not be registered with General, so needs add https://github.com/miguelraz/DoctorDocstrings.jl
)
It gives a terminal menu with the last n
entries from the REPL (n
= 25 by default), and lets you choose which ones to copy to the clipboard.