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

Re: Ability to set HISTNO to a certain position from within zshrc



On Sep 10, 11:21pm, Felix Rosencrantz wrote:
}
} Is there a way to start from a point in the primed history from my .zshrc?

Not exactly, but I think you can get the effect you want by doing:

print -s 'the first command in your sequence'
print -s 'the next command in your sequence'
print -s 'and so on'
print -s 'etc etc etc'
print -z 'the first command in your sequence'

If at this point you invoke accept-and-infer-next-history, you should end
up exactly where you want to be.

If the first command in your sequence is not unique among others in the
sequence, just make it so by doing

print -s ': BEGIN ; the first command in your sequence'
print -s ...
print -z ': BEGIN ; the first command in your sequence'

Rather than using 'print -s ...' you might consider placing the commands
in a file and loading them with 'fc -R'.  Of course, you still need the
final 'print -z' to set up the interactive part.



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