zsh-users
 help / color / mirror / code / Atom feed
* How to enable history completion in command line?
@ 2013-01-01 22:44 Han Pingtian
  2013-01-01 23:00 ` Karoly Negyesi
  2013-01-02  0:08 ` Bart Schaefer
  0 siblings, 2 replies; 4+ messages in thread
From: Han Pingtian @ 2013-01-01 22:44 UTC (permalink / raw)
  To: zsh-user

Hello,

How can I enable history completion in the command line? That's typing
a command then hit some key to let zsh completes the whole command 
line based on history.

Thanks in advance.


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

* Re: How to enable history completion in command line?
  2013-01-01 22:44 How to enable history completion in command line? Han Pingtian
@ 2013-01-01 23:00 ` Karoly Negyesi
  2013-01-02  0:08 ` Bart Schaefer
  1 sibling, 0 replies; 4+ messages in thread
From: Karoly Negyesi @ 2013-01-01 23:00 UTC (permalink / raw)
  To: Han Pingtian; +Cc: zsh-user

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

Looking at
http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#History-Controlmy
educated guess would be to bind history-beginning-search-backward to
something

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

* Re: How to enable history completion in command line?
  2013-01-01 22:44 How to enable history completion in command line? Han Pingtian
  2013-01-01 23:00 ` Karoly Negyesi
@ 2013-01-02  0:08 ` Bart Schaefer
  2013-01-02  3:19   ` Han Pingtian
  1 sibling, 1 reply; 4+ messages in thread
From: Bart Schaefer @ 2013-01-02  0:08 UTC (permalink / raw)
  To: zsh-user

On Jan 2,  6:44am, Han Pingtian wrote:
}
} How can I enable history completion in the command line? That's typing
} a command then hit some key to let zsh completes the whole command 
} line based on history.

Are you sure you're not looking for history-beginning-search-backward?

Completion is extremely word-oriented, so using it to retrieve anything
that has whitespace and other syntactic separators is difficult.  There
are tricks you can do with "compadd -Q -U" to cause multi-word strings
to be inserted onto the command line, but attempting to do any sort of
menu completion (with limited exceptions for menu selection) will fail
because completion will begin to limit itself to the single word nearest
the cursor as soon as the first replacement is done.


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

* Re: How to enable history completion in command line?
  2013-01-02  0:08 ` Bart Schaefer
@ 2013-01-02  3:19   ` Han Pingtian
  0 siblings, 0 replies; 4+ messages in thread
From: Han Pingtian @ 2013-01-02  3:19 UTC (permalink / raw)
  To: zsh-users

On Tue, Jan 01, 2013 at 04:08:01PM -0800, Bart Schaefer wrote:
> On Jan 2,  6:44am, Han Pingtian wrote:
> }
> } How can I enable history completion in the command line? That's typing
> } a command then hit some key to let zsh completes the whole command 
> } line based on history.
> 
> Are you sure you're not looking for history-beginning-search-backward?
> 
Thanks, Bart and Karoly.

history-beginning-search-backward works just fine. I was just curious to the 
feature about '_history_complete_word' discussed in previous letter. Now
it looks like it will show a menu to the user for selection. This isn't
really useful I think. I'm going to bind up-arrow and down-arrow  to
'history-beginning-search-backward' and 'history-beginning-search-forward'
respectively. 


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

end of thread, other threads:[~2013-01-02  4:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-01 22:44 How to enable history completion in command line? Han Pingtian
2013-01-01 23:00 ` Karoly Negyesi
2013-01-02  0:08 ` Bart Schaefer
2013-01-02  3:19   ` Han Pingtian

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