Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: search through alternative HISTFILE



Hi, last update, hopefully.

I found out that when I just append several history files to generate ACC_HISTFILE, setting HISTNO to the number of lines (+1) in ACC_HISTFILE, does not necessarily point zle to the end of the history. I am not sure why this happens (maybe it has to do with duplicate removals in the internal history representation?). If the value of HISTNO set in this way turns out to be invalid, it seems to be reset to its original value. I think the correct way to deal with this is to use the end-of-history widget to move to the end of the newly loaded history.

The resulting widget is then like this:

function accumulated-history-incremental-search-backward () {
    fc -p $ACC_HISTFILE
    zle .end-of-history
    zle .history-incremental-search-backward
    fc -P
    zle .end-of-history
}

Maarten



Messages sorted by: Reverse Date, Date, Thread, Author