a tiny, local-first shell history manager with fuzzy search.
Something went wrong. Try again.
1234567891011121314151617181920212223242526# run: diethist init fish | source# guard against a missing binary erroring at every prompt.if command -v diethist >/dev/null 2>&1 function __diethist_record --on-event fish_postexec set -l exit $status test -n "$argv"; and diethist add --exit $exit -- $argv end
function __diethist_search # string collect: keep multi-line output as one element set -l out (diethist search -- (commandline -b) | string collect) # $pipestatus[1] is diethist's exit code; $status reflects `set` set -l rc $pipestatus[1]
if test $rc -eq 0 -a -n "$out" commandline -r -- $out commandline -C (string length -- $out) end commandline -f repaint end
bind \cr __diethist_search # also bind in vi insert mode bind -M insert \cr __diethist_searchend