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

Re: Command Completion and up-arrow



Hi Anthony -

I have incorporated this and it works fabulously.

Thanks very much.



Corwin

Anthony R Fletcher wrote:
You might also try

	bindkey "^N" history-beginning-search-forward
	bindkey "^P" history-beginning-search-backward

This searches on the complete string to the left of the cursor and not
just the first work on the command line.

		Anthony

On 28 Oct 2008 at 16:14:27, Corwin Zechar wrote:
  
Thanks very much Mikael.

The syntax required is:

        bindkey '^[[A' up-line-or-search
        bindkey '^[[B' down-line-or-search


Corwin

Mikael Magnusson wrote:

    2008/10/28 Corwin Zechar <czech@xxxxxxxxx>:


        Hi -

        In tcsh, when I put the following lines in my .tcshrc:

              bindkey -k up history-search-backward
              bindkey -k down history-search-forward

        The effect is that when I type one or more characters and press up-arrow,
        tcsh attempts to match commands in my command history to the characters I
        have typed.

        Is there a way to do this in zsh?


    yes



        Do I need to write a completion function?


    no

    Just use the same commands as you used in tcsh, but drop the -k and
    you have to write the literal code for "up" and "down", ie something
    like ^[[A and ^[[B.




    

  



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