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

Re: Better way to execute commands from history?



2009/9/3 Greg Klanderman <gak@xxxxxxxxxxxxxx>:
>
>>>>>> On September 2, 2009 Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
>
>> If you rebind ^R (and ^[^R) to history-incremental-pattern-search-forward
>> (the default is without the "pattern-"), you can press ^R and type cd*link
>> to get the same result, but you can iterate backwards as usual too.
>
> Nice.. anyone know how hard it would be to make a regex variant?

These widgets are implemented in the C code, not as shell code, so it would
take at least some work. Maybe not that much, it looks like (and I'm
half talking
out of my ass here) the doisearch() function already takes a 'pattern'
argument that
could be extended to be an enum instead of on/off, and have it use
regcomp/regexec
instead of the builtin patcompile() function family. (I'm not
volunteering to do this).

-- 
Mikael Magnusson



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