Open mbauhardt opened 1 year ago
Indeed it does. Let me try to make this functionality portable.
I'll try to see what I can do in pure mksh, and then move to portable versions of external tools that should be as widely available as possible.
I ported your idea into as a kind of prototype in my dotfiles but with fzy
and not fzf
on a netbsd.
function __fzy_history__ {
history 1 | sort -k2 | uniq -f1 | sort -k1nr | sed 's/[[:space:]]/\t/' | fzy -l 25 | sed 's/^[0-9\t]*//'
}
it is working okayish, but I believe the newes dupclicates are removed from the final list, and not the oldest ones.
Hey, it looks like the history ctrl-r depends on the GNU version of sed/sort/uniq
any chance to migrate it to support non-gnu version of these tools?
I'm on
NetBSD 9.1 (GENERIC)