zsh-users
 help / color / mirror / code / Atom feed
* Re: two useful binds
@ 2006-04-05  5:38 Drew Perttula
  0 siblings, 0 replies; 6+ messages in thread
From: Drew Perttula @ 2006-04-05  5:38 UTC (permalink / raw)
  To: zsh-users

On Tue, 2006-04-04 at 08:45 +1000, Michael Wardle wrote:
> My favorites:
> 
> Alt-p
> 	cp foo/bar/file.dat /really/long/path
> 	(many commands including other copies)
> 	cp<Alt-p> or cp f<Alt-p>
> 
> this works better with Alt-p bound to history-beginning-search-backward
> instead of history-search-backward.


But how do you know how much line prefix to type in order to get a
correct match, and how do you efficiently deal with multiple history
lines with the same long prefix? I find
history-incremental-search-backward to work better since it has neither
of those issues--

cp foo/bar/file.dat /really/long/path
...
<ctrl-r>foo

and I can stop typing as soon as the correct line appears. (Or, keep
pressing ctrl-r to step through previous matches.)





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

* Re: two useful binds
@ 2006-04-05 14:56 Bart Schaefer
  0 siblings, 0 replies; 6+ messages in thread
From: Bart Schaefer @ 2006-04-05 14:56 UTC (permalink / raw)
  To: zsh-users

On Apr 4, 10:38pm, Drew Perttula wrote:
} Subject: Re: two useful binds
}
} On Tue, 2006-04-04 at 08:45 +1000, Michael Wardle wrote:
} > this works better with Alt-p bound to history-beginning-search-backward
} > instead of history-search-backward.
} 
} But how do you know how much line prefix to type in order to get a
} correct match, and how do you efficiently deal with multiple history
} lines with the same long prefix?

One can type alt-p repeatedly to continue searching, just as with ctrl-r.
If necessary, one can type the binding for end-of-buffer-or-history to
get back to the original pattern, add more text, and then alt-p again.

I'm not necessarily advocating this over incremental search, but you
asked, so ...


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

* Re: two useful binds
@ 2006-04-04  2:14 Sami Samhuri
  0 siblings, 0 replies; 6+ messages in thread
From: Sami Samhuri @ 2006-04-04  2:14 UTC (permalink / raw)
  To: zsh-users

Michael Wardle wrote:
> My favorites:
[...]
> Tab
> 	vim foo*.c<Tab>
> 	vim !$<Tab>

In addition to !$<tab> you can use Alt-. (or ESC .) to recall the last argument. 
That saves a couple keystrokes, and it works in bash. IIRC !$<tab> doesn't 
expand in bash.

Unfortunately it's hard for me to remember this one. I'm already used to !$ and 
my fingers just do it. Plus if you don't have alt and ESC is far away on your 
keyboard then it can be quicker to !$<tab>.

-- 
Sam


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

* Re: two useful binds
@ 2006-04-03 22:45 Michael Wardle
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Wardle @ 2006-04-03 22:45 UTC (permalink / raw)
  To: zsh-users

My favorites:

Alt-p
	cp foo/bar/file.dat /really/long/path
	(many commands including other copies)
	cp<Alt-p> or cp f<Alt-p>

this works better with Alt-p bound to history-beginning-search-backward
instead of history-search-backward.

Tab
	vim foo*.c<Tab>
	vim !$<Tab>

plus the other familiar uses of Tab.



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

* Re: two useful binds
@ 2006-04-03 20:23 Mikael Magnusson
  0 siblings, 0 replies; 6+ messages in thread
From: Mikael Magnusson @ 2006-04-03 20:23 UTC (permalink / raw)
  To: zzapper; +Cc: zsh-users

On 4/3/06, zzapper <david@tvis.co.uk> wrote:
> Hi,
>
> Hi thanks 2 whoever 4 these 2 binds
>
>
> bindkey -M viins '^O' copy-prev-shell-word
> bindkey '^L' push-line # push current command into a buffer
>
>
> the push-line allows you halfway thru a command to temporarily break-away
> and type and excute another command, you then automatically return to the
> command you were editting
>
> You WANT this!
>
> & your best binds? (Much binding in the Marsh : Obscure cultural
> reference))

I like push-input better, it works for multiline edits as well. My
zshrc is available here if you want to look,
http://mikachu.ath.cx/slask/dot-zshrc
Two other useful bindings are meta-a (alt-a) for accepting input and
keeping it, and ctrl-o for accepting input and going to next line in
history. Most of you are probably aware of them already though.

--
Mikael Magnusson

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

* two useful binds
@ 2006-04-03 19:32 zzapper
  0 siblings, 0 replies; 6+ messages in thread
From: zzapper @ 2006-04-03 19:32 UTC (permalink / raw)
  To: zsh-users

Hi,

Hi thanks 2 whoever 4 these 2 binds


bindkey -M viins '^O' copy-prev-shell-word
bindkey '^L' push-line # push current command into a buffer


the push-line allows you halfway thru a command to temporarily break-away 
and type and excute another command, you then automatically return to the 
command you were editting

You WANT this!

& your best binds? (Much binding in the Marsh : Obscure cultural 
reference))


-- 
http://successtheory.com/tips/ 100 FREE Success and Self-Improvement Tips



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

end of thread, other threads:[~2006-04-05 14:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-05  5:38 two useful binds Drew Perttula
  -- strict thread matches above, loose matches on Subject: below --
2006-04-05 14:56 Bart Schaefer
2006-04-04  2:14 Sami Samhuri
2006-04-03 22:45 Michael Wardle
2006-04-03 20:23 Mikael Magnusson
2006-04-03 19:32 zzapper

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).