Hacker News new | ask | show | jobs
by larkery 3358 days ago
It appears I am outside the edit window, but [3] should be https://github.com/larkery/zsh/blob/master/histdb-merge (no .zsh). Thanks for pointing that out.

I don't use a zsh package manager and don't really want to learn one, but if you can tell me the minimal glue I need to add to make these files into a package I will happily duplicate them into another repository and keep them up to date there. Ed.: https://github.com/larkery/zsh-histdb

I haven't done anything to import the history file because some of the information is missing so it would be a bit untidy. You could do something like

    history 0 | while read -r num line; do
        zshaddhistory "$line"
    done
This will make bogus entries where the history includes newlines; you could probably use a loop on history number instead, or do something in the while loop to accumulate split lines by looking at "$num" and seeing if it goes up.