zsh-users
 help / color / mirror / code / Atom feed
* Useful query-replace zle widget
@ 2002-12-19  2:53 Philippe Troin
  2003-01-16 15:09 ` Felix Rosencrantz
  0 siblings, 1 reply; 3+ messages in thread
From: Philippe Troin @ 2002-12-19  2:53 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 722 bytes --]

Hi,

I've been using these for a while and it's time for me to share
them... It involves `creative' use of zle... It's zsh's answer to
emacs's query-replace.

How to use:
 1. You need the read-within-zle function.
 2. Drop read-within-zle and query-replace along your fpath
 3. Add the following to your .zshrc:
        autoload -zU query-replace read-within-zle
        zle -N query-replace
        bindkey "^[%" query-replace
        bindkey "\M-%" query-replace # only if using bindkey -m
 4. Use M-x query-replace or M-% to start query-replace'ing.

Enclose these in the zsh distribution if you find them useful. Both
functions are GPL'ed but I'm willing to change the license if needed
for inclusion into zsh.

Phil.

[-- Attachment #2: query-replace --]
[-- Type: application/x-sh, Size: 2398 bytes --]

[-- Attachment #3: read-within-zle --]
[-- Type: application/x-sh, Size: 1200 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Useful query-replace zle widget
  2002-12-19  2:53 Useful query-replace zle widget Philippe Troin
@ 2003-01-16 15:09 ` Felix Rosencrantz
  2003-01-24  1:55   ` Philippe Troin
  0 siblings, 1 reply; 3+ messages in thread
From: Felix Rosencrantz @ 2003-01-16 15:09 UTC (permalink / raw)
  To: Philippe Troin, zsh-users

Seems like it might be useful.

Some problems I had.
1) Didn't handle backspace (vs. del) well, and other non-self-insert keys
2) If I was at the eol, it did nothing.

Also, a feature request for zle that will be rejected by workers...
3) Some sort of highlighting capability in zle, to see the selection.

-FR
--- Philippe Troin <phil@fifi.org> wrote:
> Hi,
> 
> I've been using these for a while and it's time for me to share
> them... It involves `creative' use of zle... It's zsh's answer to
> emacs's query-replace.
> 
> How to use:
>  1. You need the read-within-zle function.
>  2. Drop read-within-zle and query-replace along your fpath
>  3. Add the following to your .zshrc:
>         autoload -zU query-replace read-within-zle
>         zle -N query-replace
>         bindkey "^[%" query-replace
>         bindkey "\M-%" query-replace # only if using bindkey -m
>  4. Use M-x query-replace or M-% to start query-replace'ing.
> 
> Enclose these in the zsh distribution if you find them useful. Both
> functions are GPL'ed but I'm willing to change the license if needed
> for inclusion into zsh.
> 
> Phil.
> 

> ATTACHMENT part 2 application/x-sh 


> ATTACHMENT part 3 application/x-sh 




__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Useful query-replace zle widget
  2003-01-16 15:09 ` Felix Rosencrantz
@ 2003-01-24  1:55   ` Philippe Troin
  0 siblings, 0 replies; 3+ messages in thread
From: Philippe Troin @ 2003-01-24  1:55 UTC (permalink / raw)
  To: Felix Rosencrantz; +Cc: zsh-users

Felix Rosencrantz <f_rosencrantz@yahoo.com> writes:

> Seems like it might be useful.
> 
> Some problems I had.
> 1) Didn't handle backspace (vs. del) well, and other non-self-insert
> keys

Nope, from within query-replace, the only recognized keys are:

 - backspace: erase one character
 - enter: terminate string
 - CTRL-C: abort

Improvements for read-within-zle are welcome.

> 2) If I was at the eol, it did nothing.

That's a feature: substitutions only happen after the current
position... Like in emacs.

> Also, a feature request for zle that will be rejected by workers...
> 3) Some sort of highlighting capability in zle, to see the selection.

Can't do anything about this, unless someone extends zle.

Phil.
 
> -FR
> --- Philippe Troin <phil@fifi.org> wrote:
> > Hi,
> > 
> > I've been using these for a while and it's time for me to share
> > them... It involves `creative' use of zle... It's zsh's answer to
> > emacs's query-replace.
> > 
> > How to use:
> >  1. You need the read-within-zle function.
> >  2. Drop read-within-zle and query-replace along your fpath
> >  3. Add the following to your .zshrc:
> >         autoload -zU query-replace read-within-zle
> >         zle -N query-replace
> >         bindkey "^[%" query-replace
> >         bindkey "\M-%" query-replace # only if using bindkey -m
> >  4. Use M-x query-replace or M-% to start query-replace'ing.
> > 
> > Enclose these in the zsh distribution if you find them useful. Both
> > functions are GPL'ed but I'm willing to change the license if needed
> > for inclusion into zsh.
> > 
> > Phil.
> > 
> 
> > ATTACHMENT part 2 application/x-sh 
> 
> 
> > ATTACHMENT part 3 application/x-sh 
> 
> 
> 
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-01-24  1:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-19  2:53 Useful query-replace zle widget Philippe Troin
2003-01-16 15:09 ` Felix Rosencrantz
2003-01-24  1:55   ` Philippe Troin

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).